Related
I create login form, have email and password fields both form place changes position in chrome and safari browser
/*LOGIN*/
.login-container{
display: flex;
width: 100%;
min-height: 100vh;
}
.login-form:before{
content: "";
position: absolute;
bottom: 0px;
right: 50px;
height: 800px;
width: 800px;
background: transparent;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 900px;
}
.login-form{
flex-basis: 575px;
flex-grow: 0;
position: relative;
background: linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -moz-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -webkit-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -ms-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -o-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
padding: 75px;
}
.login-form:after{
content: "";
position: absolute;
bottom: 0px;
right: 130px;
height: 600px;
width: 600px;
background: transparent;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 600px;
}
.login-form .band-identity{
height: 85px;
width: 85px;
border-radius: 20px 35px 20px 35px;
background-color: #000;
display: inline-flex;
align-items: center;
justify-content: center;
border: 5px solid #fff;
}
.login-form .brand-heading{
flex-grow: 1;
flex-basis: 0;
}
.login-form h3.page-title{
font-family: poppins-regular;
font-size: 24px;
background-color: #000000;
border-radius: 100px;
padding: 12px 30px 17px 30px;
color: #fff;
display: inline-flex;
margin-right: -150px;
float: right;
letter-spacing: 1px;
}
.login-container h4.page-title{
font-family: poppins-regular;
font-size: 24px;
background-color: #000000;
border-radius: 100px 0px 0px 100px;
padding: 20px 30px 25px 30px;
color: #fff;
display: inline-flex;
position: absolute;
bottom: 100px;
right: 0px;
}
.login-form h1 span{
font-family: poppins-medium;
font-size: 26px;
color: #000;
display: block;
line-height: 40px;
}
.login-form h1{
font-family: poppins-bold;
color: #324ee1;
font-size: 42px;
position: relative;
padding: 35px 0px 60px 0px;
}
.login-form h1:after{
content: "";
bottom: 0px;
right: 27px;
height: 50px;
width: 50px;
border-radius: 50px;
border: 10px solid #ffc000;
position: absolute;
}
.login-banner{
flex-grow: 1;
flex-basis: 0;
}
.login-banner img{
height: 100%;
width: 100%;
object-fit: cover;
}
form.material-form{
position: relative;
z-index: 1;
}
.material-form .form-group{
margin-bottom: 50px;
}
.material-form label{
color: rgba(0,0,0,0.7);
font-size: 18px;
margin-bottom: 5px;
font-family: avenir-roman;
opacity: 0.5;
}
.material-form a.btn-send-message{
white-space: nowrap;
}
.material-form #errorHandling{
display: none;
}
.material-form .form-group i {
position: absolute;
left: 15px;
top: 45px;
color: rgba(0, 0, 0, 0.60);
font-size: 20px;
}
.material-form .form-group p {
font-family: ubuntu-regular;
font-size: 18px;
opacity: 0.6;
}
.material-form input,
.material-form textarea {
margin: 0px 0px 10px 0px;
width: 100%;
display: block;
border: none;
padding: 10px 0 10px 35px;
border-bottom: solid 1px rgba(0, 0, 0, 0.15);
-webkit-transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0) calc(100% - 2px), #324ee1 calc(100% - 2px), #324ee1 100%);
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0) calc(100% - 2px), #324ee1 calc(100% - 2px), #324ee1 100%);
background-position: 0 0;
background-size: 0px 100%;
background-repeat: no-repeat;
color: rgba(0, 0, 0, 0.95);
font-size: 20px;
resize: none;
font-family: poppins-regular;
}
/* .material-form input:focus,
.material-form input:valid,
.material-form textarea:focus,
.material-form textarea:valid { */
.material-form input:focus,
.material-form textarea:focus{
box-shadow: none;
outline: none;
background-size: 100% 100%;
border-bottom: solid 1px #324ee1;
}
.material-form input::-webkit-input-placeholder,
.material-form textarea::-webkit-input-placeholder {
font-family: 'roboto', sans-serif;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
font-size: 10px;
}
.material-form input:focus::-webkit-input-placeholder,
.material-form input:valid::-webkit-input-placeholder,
.material-form textarea:focus::-webkit-input-placeholder,
.material-form textarea:valid::-webkit-input-placeholder {
color: #000;
font-size: 10px;
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
visibility: visible !important;
}
a.link-forgot-password {
font-family: avenir-roman;
font-size: 19px;
color: rgba(0, 0, 0, 0.55);
margin: 10px 0px;
display: block;
}
a.link-forgot-password:hover {
color: rgba(0, 0, 0, 0.75);
}
.btn-login{
margin-top: 35px;
transition: all 0.3s;
font-size: 20px;
}
.btn-login:hover{
color: #fff;
background-color: #3149c9;
margin-top: 32px;
transition: all 0.3s;
}
.btn-login:hover:after{
bottom: -1px;
opacity: 0.85;
}
.btn-login:hover i{
animation: 1s iconbounce forwards;
transition: 0.5s;
}
<form action="login.php" id="login" name="login" method="post" class="material-form py-sm-0">
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="email">email</label>
<i class="far fa-envelope-open"></i>
<input type="text" id="email" name="email" aria-describedby="errorHandling" placeholder="companysupport#gmail.com" >
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="password">password</label>
<i class="fa fa-key"></i>
<input type="password" id="password" name="password" aria-describedby="errorHandling" placeholder="**********" >
</div>
</div>
<div class="col-12">
Forgot your password?
</div>
<div class="col-12">
<button type="submit" class="btn-style-1 btn-lg btn-login">login <i class="fas fa-arrow-right ml-3"></i></button>
</div>
</div>
</form>
It is showing perfect for mozilla browser
It glitches as below images for chrome and safari browsers as below
Thank You
You should remove the following rules if you don't want to alter its position
.material-form input::-webkit-input-placeholder,
.material-form textarea::-webkit-input-placeholder {
font-family: 'roboto', sans-serif;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
font-size: 10px;
}
.material-form input:focus::-webkit-input-placeholder,
.material-form input:valid::-webkit-input-placeholder,
.material-form textarea:focus::-webkit-input-placeholder,
.material-form textarea:valid::-webkit-input-placeholder {
color: #000;
font-size: 10px;
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
visibility: visible !important;
}
/*LOGIN*/
.login-container {
display: flex;
width: 100%;
min-height: 100vh;
}
.login-form:before {
content: "";
position: absolute;
bottom: 0px;
right: 50px;
height: 800px;
width: 800px;
background: transparent;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 900px;
}
.login-form {
flex-basis: 575px;
flex-grow: 0;
position: relative;
background: linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -moz-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -webkit-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -ms-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -o-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
padding: 75px;
}
.login-form:after {
content: "";
position: absolute;
bottom: 0px;
right: 130px;
height: 600px;
width: 600px;
background: transparent;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 600px;
}
.login-form .band-identity {
height: 85px;
width: 85px;
border-radius: 20px 35px 20px 35px;
background-color: #000;
display: inline-flex;
align-items: center;
justify-content: center;
border: 5px solid #fff;
}
.login-form .brand-heading {
flex-grow: 1;
flex-basis: 0;
}
.login-form h3.page-title {
font-family: poppins-regular;
font-size: 24px;
background-color: #000000;
border-radius: 100px;
padding: 12px 30px 17px 30px;
color: #fff;
display: inline-flex;
margin-right: -150px;
float: right;
letter-spacing: 1px;
}
.login-container h4.page-title {
font-family: poppins-regular;
font-size: 24px;
background-color: #000000;
border-radius: 100px 0px 0px 100px;
padding: 20px 30px 25px 30px;
color: #fff;
display: inline-flex;
position: absolute;
bottom: 100px;
right: 0px;
}
.login-form h1 span {
font-family: poppins-medium;
font-size: 26px;
color: #000;
display: block;
line-height: 40px;
}
.login-form h1 {
font-family: poppins-bold;
color: #324ee1;
font-size: 42px;
position: relative;
padding: 35px 0px 60px 0px;
}
.login-form h1:after {
content: "";
bottom: 0px;
right: 27px;
height: 50px;
width: 50px;
border-radius: 50px;
border: 10px solid #ffc000;
position: absolute;
}
.login-banner {
flex-grow: 1;
flex-basis: 0;
}
.login-banner img {
height: 100%;
width: 100%;
object-fit: cover;
}
form.material-form {
position: relative;
z-index: 1;
}
.material-form .form-group {
margin-bottom: 50px;
}
.material-form label {
color: rgba(0, 0, 0, 0.7);
font-size: 18px;
margin-bottom: 5px;
font-family: avenir-roman;
opacity: 0.5;
}
.material-form a.btn-send-message {
white-space: nowrap;
}
.material-form #errorHandling {
display: none;
}
.material-form .form-group i {
position: absolute;
left: 15px;
top: 45px;
color: rgba(0, 0, 0, 0.60);
font-size: 20px;
}
.material-form .form-group p {
font-family: ubuntu-regular;
font-size: 18px;
opacity: 0.6;
}
.material-form input,
.material-form textarea {
margin: 0px 0px 10px 0px;
width: 100%;
display: block;
border: none;
padding: 10px 0 10px 35px;
border-bottom: solid 1px rgba(0, 0, 0, 0.15);
-webkit-transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) calc(100% - 2px), #324ee1 calc(100% - 2px), #324ee1 100%);
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) calc(100% - 2px), #324ee1 calc(100% - 2px), #324ee1 100%);
background-position: 0 0;
background-size: 0px 100%;
background-repeat: no-repeat;
color: rgba(0, 0, 0, 0.95);
font-size: 20px;
resize: none;
font-family: poppins-regular;
}
/* .material-form input:focus,
.material-form input:valid,
.material-form textarea:focus,
.material-form textarea:valid { */
.material-form input:focus,
.material-form textarea:focus {
box-shadow: none;
outline: none;
background-size: 100% 100%;
border-bottom: solid 1px #324ee1;
}
a.link-forgot-password {
font-family: avenir-roman;
font-size: 19px;
color: rgba(0, 0, 0, 0.55);
margin: 10px 0px;
display: block;
}
a.link-forgot-password:hover {
color: rgba(0, 0, 0, 0.75);
}
.btn-login {
margin-top: 35px;
transition: all 0.3s;
font-size: 20px;
}
.btn-login:hover {
color: #fff;
background-color: #3149c9;
margin-top: 32px;
transition: all 0.3s;
}
.btn-login:hover:after {
bottom: -1px;
opacity: 0.85;
}
.btn-login:hover i {
animation: 1s iconbounce forwards;
transition: 0.5s;
}
<form action="login.php" id="login" name="login" method="post" class="material-form py-sm-0">
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="email">email</label>
<i class="far fa-envelope-open"></i>
<input type="text" id="email" name="email" aria-describedby="errorHandling" placeholder="companysupport#gmail.com">
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="password">password</label>
<i class="fa fa-key"></i>
<input type="password" id="password" name="password" aria-describedby="errorHandling" placeholder="**********">
</div>
</div>
<div class="col-12">
Forgot your password?
</div>
<div class="col-12">
<button type="submit" class="btn-style-1 btn-lg btn-login">login <i class="fas fa-arrow-right ml-3"></i></button>
</div>
</div>
</form>
You should use the following code to support all browsers:
Example:
.input-email::-webkit-input-placeholder {
font-style: italic;
font-size: 12px;
font-weight: 600;
color: #9b9b9b;
}
/* WebKit, Blink, Edge */
.input-email:-moz-placeholder {
font-style: italic;
font-size: 12px;
font-weight: 600;
color: #9b9b9b;
}
/* Mozilla Firefox 4 to 18 */
.input-email::-moz-placeholder {
font-style: italic;
font-size: 12px;
font-weight: 600;
color: #9b9b9b;
}
/* Mozilla Firefox 19+ */
.input-email:-ms-input-placeholder {
font-style: italic;
font-size: 12px;
font-weight: 600;
color: #9b9b9b;
}
/* Internet Explorer 10-11 */
.input-email::-ms-input-placeholder {
font-style: italic;
font-size: 12px;
font-weight: 600;
color: #9b9b9b;
}
Remove this code
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
from
.material-form input:focus::-webkit-input-placeholder,
.material-form input:valid::-webkit-input-placeholder,
.material-form textarea:focus::-webkit-input-placeholder,
.material-form textarea:valid::-webkit-input-placeholder {
color: #000;
font-size: 10px;
-webkit-transform: translateY(-20px);
transform: translateY(-20px);
visibility: visible !important;
}
/*LOGIN*/
.login-container{
display: flex;
width: 100%;
min-height: 100vh;
}
.login-form:before{
content: "";
position: absolute;
bottom: 0px;
right: 50px;
height: 800px;
width: 800px;
background: transparent;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 900px;
}
.login-form{
flex-basis: 575px;
flex-grow: 0;
position: relative;
background: linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -moz-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -webkit-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -ms-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
background: -o-linear-gradient(to top left, rgba(50, 78, 225, 0.20) 0%, rgba(255, 255, 255, 0.0) 100%);
padding: 75px;
}
.login-form:after{
content: "";
position: absolute;
bottom: 0px;
right: 130px;
height: 600px;
width: 600px;
background: transparent;
border: 1px solid rgba(0, 0, 0, 0.05);
border-radius: 600px;
}
.login-form .band-identity{
height: 85px;
width: 85px;
border-radius: 20px 35px 20px 35px;
background-color: #000;
display: inline-flex;
align-items: center;
justify-content: center;
border: 5px solid #fff;
}
.login-form .brand-heading{
flex-grow: 1;
flex-basis: 0;
}
.login-form h3.page-title{
font-family: poppins-regular;
font-size: 24px;
background-color: #000000;
border-radius: 100px;
padding: 12px 30px 17px 30px;
color: #fff;
display: inline-flex;
margin-right: -150px;
float: right;
letter-spacing: 1px;
}
.login-container h4.page-title{
font-family: poppins-regular;
font-size: 24px;
background-color: #000000;
border-radius: 100px 0px 0px 100px;
padding: 20px 30px 25px 30px;
color: #fff;
display: inline-flex;
position: absolute;
bottom: 100px;
right: 0px;
}
.login-form h1 span{
font-family: poppins-medium;
font-size: 26px;
color: #000;
display: block;
line-height: 40px;
}
.login-form h1{
font-family: poppins-bold;
color: #324ee1;
font-size: 42px;
position: relative;
padding: 35px 0px 60px 0px;
}
.login-form h1:after{
content: "";
bottom: 0px;
right: 27px;
height: 50px;
width: 50px;
border-radius: 50px;
border: 10px solid #ffc000;
position: absolute;
}
.login-banner{
flex-grow: 1;
flex-basis: 0;
}
.login-banner img{
height: 100%;
width: 100%;
object-fit: cover;
}
form.material-form{
position: relative;
z-index: 1;
}
.material-form .form-group{
margin-bottom: 50px;
}
.material-form label{
color: rgba(0,0,0,0.7);
font-size: 18px;
margin-bottom: 5px;
font-family: avenir-roman;
opacity: 0.5;
}
.material-form a.btn-send-message{
white-space: nowrap;
}
.material-form #errorHandling{
display: none;
}
.material-form .form-group i {
position: absolute;
left: 15px;
top: 45px;
color: rgba(0, 0, 0, 0.60);
font-size: 20px;
}
.material-form .form-group p {
font-family: ubuntu-regular;
font-size: 18px;
opacity: 0.6;
}
.material-form input,
.material-form textarea {
margin: 0px 0px 10px 0px;
width: 100%;
display: block;
border: none;
padding: 10px 0 10px 35px;
border-bottom: solid 1px rgba(0, 0, 0, 0.15);
-webkit-transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
transition: all 0.3s cubic-bezier(0.64, 0.09, 0.08, 1);
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0) calc(100% - 2px), #324ee1 calc(100% - 2px), #324ee1 100%);
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0) calc(100% - 2px), #324ee1 calc(100% - 2px), #324ee1 100%);
background-position: 0 0;
background-size: 0px 100%;
background-repeat: no-repeat;
color: rgba(0, 0, 0, 0.95);
font-size: 20px;
resize: none;
font-family: poppins-regular;
}
/* .material-form input:focus,
.material-form input:valid,
.material-form textarea:focus,
.material-form textarea:valid { */
.material-form input:focus,
.material-form textarea:focus{
box-shadow: none;
outline: none;
background-size: 100% 100%;
border-bottom: solid 1px #324ee1;
}
.material-form input::-webkit-input-placeholder,
.material-form textarea::-webkit-input-placeholder {
font-family: 'roboto', sans-serif;
-webkit-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
font-size: 10px;
}
.material-form input:focus::-webkit-input-placeholder,
.material-form input:valid::-webkit-input-placeholder,
.material-form textarea:focus::-webkit-input-placeholder,
.material-form textarea:valid::-webkit-input-placeholder {
color: #000;
font-size: 10px;
visibility: visible !important;
}
a.link-forgot-password {
font-family: avenir-roman;
font-size: 19px;
color: rgba(0, 0, 0, 0.55);
margin: 10px 0px;
display: block;
}
a.link-forgot-password:hover {
color: rgba(0, 0, 0, 0.75);
}
.btn-login{
margin-top: 35px;
transition: all 0.3s;
font-size: 20px;
}
.btn-login:hover{
color: #fff;
background-color: #3149c9;
margin-top: 32px;
transition: all 0.3s;
}
.btn-login:hover:after{
bottom: -1px;
opacity: 0.85;
}
.btn-login:hover i{
animation: 1s iconbounce forwards;
transition: 0.5s;
}
<form action="login.php" id="login" name="login" method="post" class="material-form py-sm-0">
<div class="row">
<div class="col-12">
<div class="form-group">
<label for="email">email</label>
<i class="far fa-envelope-open"></i>
<input type="text" id="email" name="email" aria-describedby="errorHandling" placeholder="companysupport#gmail.com" >
</div>
</div>
<div class="col-12">
<div class="form-group">
<label for="password">password</label>
<i class="fa fa-key"></i>
<input type="password" id="password" name="password" aria-describedby="errorHandling" placeholder="**********" >
</div>
</div>
<div class="col-12">
Forgot your password?
</div>
<div class="col-12">
<button type="submit" class="btn-style-1 btn-lg btn-login">login <i class="fas fa-arrow-right ml-3"></i></button>
</div>
</div>
</form>
I need to create simple horizontal (left direction) flyout menu for button. I've prepared this DEMO.
.menu {
position: absolute;
right: 0;
height: 50px;
width: 50px;
color: white;
}
.menu li {
pointer-events: none;
position: relative;
display: inline-block;
vertical-align: middle;
list-style: none;
line-height: 100%;
transform: translateZ(0);
}
.menu a {
pointer-events: auto;
position: relative;
display: block;
min-width: 5em;
margin-bottom: .4em;
padding: .4em;
line-height: 100%;
font-size: 16px;
text-decoration: none;
color: white;
transition: background 0.3s;
}
.menu a:active, .menu a:focus {
background: #B44659;
}
.menu i {
display: block;
margin-bottom: .2em;
font-size: 2em;
}
.menu span {
font-size: .625em;
font-family: sans-serif;
text-transform: uppercase;
}
.menu li:hover ul {
transform: translateX(0);
background: #B44659;
}
.menu > li {
display: block;
}
.menu > li > a {
background: #7D294E;
}
.menu > li:hover {
z-index: 100;
}
.menu > li:hover a {
background: #B44659;
}
.menu > li a:hover {
background: #F56356;
}
.menu > li > a:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 100%;
width: 4px;
opacity: 0;
background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(0, 0, 0, 0.65)), color-stop(100%, rgba(0, 0, 0, 0)));
background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: -o-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: linear-gradient(to right, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=1 );
transition: opacity 0.5s;
}
.menu > li:hover a:after {
opacity: 1;
}
.menu > li ul {
position: absolute;
z-index: -1;
top: 0;
right: 100%;
height: 100%;
width: auto;
white-space: nowrap;
transform: translateX(100%);
background: #B44659;
transition: 0.5s transform;
}
<ul class="menu">
<li>
<a href="#">
<span>ITEM 1</span>
</a>
<ul>
<li>
<a href="https://google.co.uk/" target="_blank">
<span>SUBITEM 1.1</span>
</a>
</li>
<li>
<a href="https://google.co.uk/" target="_blank">
<span>SUBITEM 1.2</span>
</a>
</li>
<li>
<a href="https://google.co.uk/" target="_blank">
<span>SUBITEM 1.3</span>
</a>
</li>
</ul>
</li>
</ul>
When you hover an item, the options slide from right to the left. The problem is to hide them - now they are just moved back to the right, but I would like to completely hide them. Is it possible to achieve this with pure CSS?
You can set overflow: hidden to your menu. Also you'll need to set a bigger width so when you slide the rest of the menu it won't overflow.
.visible-item{
width: 40px;
text-align: center;
}
.menu {
position: absolute;
right: 0;
height: 30px;
width: 50px;
color: white;
display: flex;
justify-content: flex-end;
overflow: hidden;
}
.menu:hover{
width: 400px;
}
.menu li {
pointer-events: none;
position: relative;
display: inline-block;
vertical-align: middle;
list-style: none;
line-height: 100%;
transform: translateZ(0);
}
.menu a {
pointer-events: auto;
position: relative;
display: block;
min-width: 5em;
margin-bottom: .4em;
padding: .4em;
line-height: 100%;
font-size: 16px;
text-decoration: none;
color: white;
transition: background 0.3s;
}
.menu a:active, .menu a:focus {
background: #B44659;
}
.menu i {
display: block;
margin-bottom: .2em;
font-size: 2em;
}
.menu span {
font-size: .625em;
font-family: sans-serif;
text-transform: uppercase;
}
.menu li:hover ul {
transform: translateX(0);
background: #B44659;
}
.menu > li {
display: block;
}
.menu > li > a {
background: #7D294E;
}
.menu > li:hover {
z-index: 100;
}
.menu > li:hover a {
background: #B44659;
}
.menu > li a:hover {
background: #F56356;
}
.menu > li > a:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 100%;
width: 4px;
opacity: 0;
background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(0, 0, 0, 0.65)), color-stop(100%, rgba(0, 0, 0, 0)));
background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: -o-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
background: linear-gradient(to right, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6000000', endColorstr='#00000000',GradientType=1 );
transition: opacity 0.5s;
}
.menu > li:hover a:after {
opacity: 1;
}
.menu > li ul {
position: absolute;
z-index: -1;
top: 0;
right: 100%;
height: 100%;
width: auto;
white-space: nowrap;
transform: translateX(100%);
background: #B44659;
transition: 0.5s transform;
}
<ul class="menu">
<li>
<a href="#" class="visible-item">
<span>ITEM 1</span>
</a>
<ul>
<li>
<a href="https://google.co.uk/" target="_blank">
<span>SUBITEM 1.1</span>
</a>
</li>
<li>
<a href="https://google.co.uk/" target="_blank">
<span>SUBITEM 1.2</span>
</a>
</li>
<li>
<a href="https://google.co.uk/" target="_blank">
<span>SUBITEM 1.3</span>
</a>
</li>
</ul>
</li>
</ul>
I want Circle Hover Effects with CSS Transitions on <img> tag without calling the image as background image.
I have created a JSFiddle of the effect I want. But in this fiddle, image is used as a background image. I want same effect, but with image in an img tag, not as background image.
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-image: url(http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg);
}
.ch-img-2 {
background-image: url(http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg);
}
.ch-img-3 {
background-image: url(http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg);
}
.ch-info {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
opacity: 0;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
position: relative;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 65px 0 0 0;
height: 110px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.ch-info p a {
display: block;
color: #fff;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
}
.ch-info p a:hover {
color: #fff222;
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
#import url('normalize.css');
/* General Demo Style */
body {
font-family: Cambria, Georgia, serif;
background: #f9f9f9 url(../images/bg.jpg);
font-weight: 300;
font-size: 15px;
color: #333;
-webkit-font-smoothing: antialiased;
overflow-y: scroll;
overflow-x: hidden;
}
a {
color: #555;
text-decoration: none;
}
.container {
width: 100%;
position: relative;
}
.clr {
clear: both;
padding: 0;
height: 0;
margin: 0;
}
.main {
width: 90%;
margin: 0 auto;
position: relative;
}
.container > header {
margin: 10px;
padding: 20px 10px 10px 10px;
position: relative;
display: block;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
text-align: center;
}
.container > header h1 {
font-size: 32px;
line-height: 32px;
margin: 0;
position: relative;
font-weight: 300;
color: #777;
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.7);
}
.container > header h2 {
font-size: 14px;
font-weight: 300;
font-style: italic;
margin: 0;
padding: 15px 0 5px 0;
color: #888;
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.9);
}
/* Header Style */
.codrops-top {
line-height: 24px;
font-size: 11px;
background: #fff;
background: rgba(255, 255, 255, 0.6);
text-transform: uppercase;
z-index: 9999;
position: relative;
box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.1);
}
.codrops-top a {
padding: 0px 10px;
letter-spacing: 1px;
color: #333;
display: inline-block;
}
.codrops-top a:hover {
background: rgba(255, 255, 255, 0.3);
}
.codrops-top span.right {
float: right;
}
.codrops-top span.right a {
float: left;
display: block;
}
/* Demo Buttons Style */
.codrops-demos {
text-align: center;
display: block;
line-height: 30px;
padding: 5px 0px;
}
.codrops-demos a {
display: inline-block;
font-style: italic;
margin: 0px 4px;
padding: 0px 6px;
color: #aaa;
line-height: 20px;
font-size: 13px;
text-shadow: 1px 1px 1px #fff;
border: 1px solid #fff;
background: #ffffff;
/* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(47%, #f6f6f6), color-stop(100%, #ededed));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* IE10+ */
background: linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed', GradientType=0);
/* IE6-9 */
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.codrops-demos a:hover {
color: #333;
background: #fff;
}
.codrops-demos a:active {
background: #fff;
}
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover {
background: #f0f0f0;
border-color: #d9d9d9;
color: #aaa;
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#f6f6f6', GradientType=0);
/* IE6-9 */
}
.support-note span {
color: #ac375d;
font-size: 16px;
display: none;
font-weight: bold;
text-align: center;
padding: 5px 0;
}
.no-cssanimations .support-note span.no-cssanimations,
.no-csstransforms .support-note span.no-csstransforms,
.no-csstransforms3d .support-note span.no-csstransforms3d,
.no-csstransitions .support-note span.no-csstransitions {
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
<section class="main">
<ul class="ch-grid">
<li>
<div class="ch-item ch-img-1">
<div class="ch-info">
<h3>Brainiac</h3>
<p>by Daniel Nyari View on Dribbble
</p>
</div>
</div>
</li>
<li>
<div class="ch-item ch-img-2">
<div class="ch-info">
<h3>Vision</h3>
<p>by Daniel Nyari View on Dribbble
</p>
</div>
</div>
</li>
<li>
<div class="ch-item ch-img-3">
<div class="ch-info">
<h3>Cylon</h3>
<p>by Daniel Nyari View on Dribbble
</p>
</div>
</div>
</li>
</ul>
</section>
I've edited your fiddle here: http://jsfiddle.net/pedwf80h/7/
Essentially I've moved the img url from the background to within the li element. Then positioned the img absolutely and used z-index to move it to the back. The li element then uses overflow: hidden and border-radius: 100% to hide any of the image that goes outside of our li element.
Hope this helps!
Try this may be this can help for you:
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
z-index: 2;
}
.ch-info {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
opacity: 0;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
}
li {
position: relative;
overflow: hidden;
border-radius: 100%;
}
li img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.ch-item:hover {
box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
#import url('normalize.css');
/* General Demo Style */
body{
font-family: Cambria, Georgia, serif;
background: #f9f9f9 url(../images/bg.jpg);
font-weight: 300;
font-size: 15px;
color: #333;
-webkit-font-smoothing: antialiased;
overflow-y: scroll;
overflow-x: hidden;
}
a{
color: #555;
text-decoration: none;
}
.container{
width: 100%;
position: relative;
}
.clr{
clear: both;
padding: 0;
height: 0;
margin: 0;
}
.main{
width: 90%;
margin: 0 auto;
position: relative;
}
.container > header{
margin: 10px;
padding: 20px 10px 10px 10px;
position: relative;
display: block;
text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
text-align: center;
}
.container > header h1{
font-size: 32px;
line-height: 32px;
margin: 0;
position: relative;
font-weight: 300;
color: #777;
text-shadow: 1px 1px 1px rgba(255,255,255,0.7);
}
.container > header h2{
font-size: 14px;
font-weight: 300;
font-style: italic;
margin: 0;
padding: 15px 0 5px 0;
color: #888;
text-shadow: 1px 1px 1px rgba(255,255,255,0.9);
}
/* Header Style */
.codrops-top{
line-height: 24px;
font-size: 11px;
background: #fff;
background: rgba(255, 255, 255, 0.6);
text-transform: uppercase;
z-index: 9999;
position: relative;
box-shadow: 1px 0px 2px rgba(0,0,0,0.1);
}
.codrops-top a{
padding: 0px 10px;
letter-spacing: 1px;
color: #333;
display: inline-block;
}
.codrops-top a:hover{
background: rgba(255,255,255,0.3);
}
.codrops-top span.right{
float: right;
}
.codrops-top span.right a{
float: left;
display: block;
}
/* Demo Buttons Style */
.codrops-demos{
text-align:center;
display: block;
line-height: 30px;
padding: 5px 0px;
}
.codrops-demos a{
display: inline-block;
font-style: italic;
margin: 0px 4px;
padding: 0px 6px;
color: #aaa;
line-height: 20px;
font-size: 13px;
text-shadow: 1px 1px 1px #fff;
border: 1px solid #fff;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.codrops-demos a:hover{
color: #333;
background: #fff;
}
.codrops-demos a:active{
background: #fff;
}
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover{
background: #f0f0f0;
border-color: #d9d9d9;
color: #aaa;
box-shadow: 0 1px 1px rgba(255,255,255,0.7);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f6f6', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}
.support-note span{
color: #ac375d;
font-size: 16px;
display: none;
font-weight: bold;
text-align: center;
padding: 5px 0;
}
.no-cssanimations .support-note span.no-cssanimations,
.no-csstransforms .support-note span.no-csstransforms,
.no-csstransforms3d .support-note span.no-csstransforms3d,
.no-csstransitions .support-note span.no-csstransitions{
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
<section class="main">
<ul class="ch-grid">
<li>
<img src="http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg" alt="Vision">
<div class="ch-item">
<div class="ch-info">
</div>
</div>
</li>
</ul>
</section>
Additional reference website...
Reference link
#import url(http://fonts.googleapis.com/css?family=Cabin:700);
body {
padding-top: 2em;
background-color: #c02227;
}
.circle-container {
position: relative;
perspective: 1000;
margin: 0 auto;
}
.circle-container:hover .circle {
transform: rotate3d(45, 45, 0, 180deg);
}
.circle-container:hover .outer-ring {
transform: rotate3d(45, 0, 0, 180deg);
}
.circle-container:hover .outer-outer-ring {
transform: rotate3d(0, 45, 0, 180deg);
}
.circle-container, .front, .back {
width: 175px;
height: 175px;
background-color: rgba(0,0,0,0);
}
.circle, .outer-ring, .outer-outer-ring {
transition: 0.5s;
transform-style: preserve-3d;
transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
}
.circle {
position: relative;
width: 175px;
height: 175px;
}
.front, .back {
border-radius: 50%;
box-shadow: 0px 0px 20px rgba(0,0,0,0.4);
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front {
background-color: #fff;
z-index: 2;
}
.front p {
margin-top: 1.2em;
font-family: cabin, sans-serif;
font-weight: 700;
font-size: 3em;
text-align: center;
color: #c02227;
}
.back {
transform: rotate3d(45,45,0,180deg);
background-color: #fff;
}
.back-logo {
width: 60%;
display: block;
margin: 2em auto;
}
.outer-ring {
position: absolute;
top: -10px;
left: -10px;
border-radius: 50%;
border: 2px solid #fff;
width: 191px;
height: 191px;
background-color: rgba(255,255,255,0);
box-shadow: 0px 0px 20px rgba(0,0,0,0.4);
}
.outer-outer-ring {
position: absolute;
top: -20px;
left: -20px;
border-radius: 50%;
border: 2px solid #fff;
width: 211px;
height: 211px;
background-color: rgba(255,255,255,0);
box-shadow: 0px 0px 20px rgba(0,0,0,0.4);
}
I am developing a multiline menu in bootstrap and I have used a bootstrap css class “nav-justified” for width equality of every menu. The class “nav-justified” is working very well for equal width. But I need another option that is equal height, maintain height equality for every menu in that section. I added my problem with graphically in below:
nav.navbar {
width: 100%;
border: none;
margin: 0;
padding: 0;
background: #adadad;
border-bottom: 1px solid #8e8e8e
/*#8e8e8e*/
;
}
nav.navbar-fixed-top {
height: 150px;
position: fixed;
margin-left: 5px;
margin-right: 5px;
top: 26px;
bottom: 0;
right: 0;
left: 0;
float: none;
padding: 5px 5px 0px 5px;
background: #adadad;
/*mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #202020 25%, #202020 75%, rgba(255, 255, 255, 0) 100%);*/
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
nav .container-fluid {
padding-right: 0px;
padding-left: 0px;
height: 100%;
}
.navbar-header .navbar-toggle .icon-bar {
background-color: black;
}
ul.top-menu {
/*width: 100%;*/
border: none;
margin: 0px 0px 0px 0px;
padding: 0;
/*height: 44px;*/
border-bottom: 1px solid #bbbbbb;
border-radius: 6px;
background: #5c5a5a;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#5c5a5a), to(#3d3b3b));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #3d3b3b, #5c5a5a);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #3d3b3b, #5c5a5a);
/* IE 10 */
background: -ms-linear-gradient(top, #3d3b3b, #5c5a5a);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #3d3b3b, #5c5a5a);
vertical-align: middle;
background: #353535;
/* Old browsers */
background: -moz-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #353535), color-stop(50%, #5c5a5a), color-stop(100%, #303030));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%);
/* IE10+ */
background: linear-gradient(to bottom, #353535 0%, #5c5a5a 50%, #303030 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#353535', endColorstr='#303030', GradientType=0);
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
ul.top-menu > li.active {
background: #ff0000;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6f0505), to(#ff0000));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #ff0000, #6f0505);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #ff0000, #6f0505);
/* IE 10 */
background: -ms-linear-gradient(top, #ff0000, #6f0505);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #ff0000, #6f0505);
outline: none;
}
ul.top-menu > li:last-child.active {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
ul.top-menu > li:first-child.active {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
ul.top-menu > li:hover {
cursor: pointer;
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
ul.top-menu > li:last-child:hover {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
ul.top-menu > li:first-child:hover {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
ul.sub-menu {
/*width: 100%;*/
border: none;
margin: 0;
padding: 0;
vertical-align: middle;
}
ul.sub-menu > ul > li {
display: block;
/*width: 100%;*/
border: none;
margin: 0;
padding: 0;
vertical-align: middle;
}
ul.sub-menu > li > ul > li > a {
text-align: left;
vertical-align: middle;
/*height: auto;*/
/*width: 100%;*/
color: #101010;
font-size: 10pt;
white-space: nowrap;
text-transform: capitalize;
text-shadow: 1px 1px 1px rgba(200, 200, 200, 0.9);
}
ul.sub-menu > li > ul > li > a:hover {
cursor: pointer;
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
color: #000;
}
ul.dropdown-menu {
margin-top: -2px;
/*position:relative;*/
width: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
li.dropdown:hover > ul.dropdown-menu {
display: block;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
top: 0px;
left: 100%;
margin-top: -1px;
margin-left: -1px;
box-sizing: border-box;
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
.dropdown-menu > ul > ul {
border-radius: 0px;
width: 100%;
}
.dropdown-menu > li > a {
display: block;
padding: 5px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #101010;
font-size: 10pt;
white-space: nowrap;
text-transform: capitalize;
width: 100%;
}
.dropdown-menu > li > a:hover {
background: #ff0000;
}
.dropdown-menu > li {
/*box-shadow:0 1px 1px rgba(0, 0, 0, 0.1);*/
box-sizing: border-box;
border-bottom: 0.5px solid #d5d5d5;
border-top: 0.5px solid #f9f9f9;
border-radius: 0px;
min-width: 260px;
width: 100%;
background: #f2f2f2;
text-align: left;
}
.dropdown-menu > ul > li > a {
box-sizing: border-box;
border-radius: 0px;
width: 100%;
}
.dropdown-toggle > i {
text-align: right;
right: 10px;
position: absolute;
overflow: hidden;
line-height: 1.42857143;
}
.dropdown-menu > li.manage-bar {
background: #bbbbbb;
}
.dropdown-menu > li.manage-bar a {
color: #101010;
}
.dropdown-menu > li.report-bar {
background: #bbbbbb;
}
.dropdown-menu > li.report-bar a {
color: #101010;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="btn btn-primary navbar-toggle collapsed" data-toggle="collapse" data-target="#menu-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<a class="navbar-brand" href="#">Brand</a>-->
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="menu-navbar-collapse-1">
<ul class="nav nav-justified top-menu">
<li class="active">
HOME
</li>
<li>
GARMENTS
</li>
<li>
YARN DYEING
</li>
<li>
KNITTING
</li>
<li>
FABRIC DYEING
</li>
<li>
COMMON MODULES
</li>
<li>
GENERAL SETTING
</li>
</ul>
<ul class="nav nav-justified">
<li>
<ul class="nav nav-justified" style="border: 1px solid #f00">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">ADMIN <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
Action
</li>
<li>
Another action
</li>
<li>
Something else here
</li>
<li>
Separated link
</li>
<li>
One more separated link
</li>
</ul>
</li>
</ul>
<ul class="nav nav-justified" style="border: 1px solid #f00">
<li>
HELP
</li>
</ul>
</li>
<li>
<ul class="nav nav-justified">
<li>
SUPPORT
</li>
</ul>
<ul class="nav nav-justified">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">CHAT <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
Action
</li>
<li>
Another action
</li>
<li>
Something else here
</li>
<li>
Separated link
</li>
<li>
One more separated link
</li>
</ul>
</li>
</ul>
</li>
<li>
<ul class="nav nav-justified">
<li>
NO MENU
</li>
</ul>
<ul class="nav nav-justified">
<li>
NO MENU
</li>
</ul>
</li>
<li>
<ul class="nav nav-justified">
<li>
NO MENU
</li>
</ul>
<ul class="nav nav-justified">
<li>
NO MENU
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
EDIT==================================================
I have fixed this problem in plunker
But another problem is arising bootstrap dropdown popup does not come properly in IE, Like as below
I need this solution, this is working in chrome and mozila, whats the problem of me?
The complete solution is here
HTML CODE
html {
font-size: 10px;
position: relative;
min-height: 100%;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
}
html, body {
overflow-x: hidden;
height: 100%;
margin: 0;
}
body {
background: #efeff0 /*url('../img/background.jpg') no-repeat*/;
background-size: cover;
background-attachment: fixed;
/*font: 300 16px 'segoe', Helvetica, Arial, sans-serif;*/
background-color: #efeff0;
color: #303030;
font-family: segoe,"Helvetica Neue",Arial,sans-serif;
font-size: 14px;
line-height: 1.42857;
height: 100%;
width: 100%;
position: absolute;
/*border:5px solid #5f5f5f;*/
overflow: hidden;
}
/* Customize the nav-justified links to be fill the entire space of the .navbar */
.navbar-header .navbar-toggle .icon-bar {
background-color: black;
}
.nav-justified > li > a {
color: inherit;
}
.nav-justified > .active > a,
.nav-justified > .active > a:hover,
.nav-justified > .active > a:focus {
background-image: none;
background: none;
-webkit-box-shadow: inset 0 3px 7px rgba(0,0,0,.15);
box-shadow: inset 0 3px 7px rgba(0,0,0,.15);
}
.nav-justified > li:first-child > a {
/*border-radius: 5px 5px 0 0;*/
}
.nav-justified > li:last-child > a {
/*border-bottom: 0;
border-radius: 0 0 5px 5px;*/
}
.nav-justified > li > a:hover {
background: none;
background-image: none;
}
.nav > li > a {
padding: 5px 10px 0px 20px;
}
#media (min-width: 768px) {
/*.nav-justified {
max-height: 52px;
}*/
.nav-justified > li > a {
border-right: 0.5px solid #404040;
border-left: 0.5px solid #353535;
color: #fff;
text-align: left;
}
.nav-justified > li:first-child > a {
border-left: 0;
border-radius: 6px 0 0 6px;
}
.nav-justified > li:last-child > a {
border-right: 0;
border-radius: 0 6px 6px 0;
}
}
.navbar-collapse {
border-top: 0px solid #4b4b4b;
/*padding:0px 5px 0px 5px;*/
}
/*.navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse, .navbar-fixed-bottom .navbar-collapse {
padding: 5px 5px 0px 5px;
}*/
.container > .navbar-header, .container-fluid > .navbar-header, .container > .navbar-collapse, .container-fluid > .navbar-collapse {
margin: 0px 5px 0px 5px;
}
nav.navbar-fixed-top {
height: 150px;
position: fixed;
top: 26px;
bottom: 0;
right: 0;
left: 0;
float: none;
background: #adadad;
/*mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #202020 25%, #202020 75%, rgba(255, 255, 255, 0) 100%);*/
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
.navbar-fixed-top, .navbar-fixed-bottom {
position: relative;
}
nav .container-fluid {
padding-right: 0px;
padding-left: 0px;
overflow: visible;
}
nav.navbar {
/*display: block;*/
width: 100%;
border: none;
margin: 0;
padding: 0;
background: #adadad;
border-bottom: 1px solid #8e8e8e /*#8e8e8e*/;
}
ul.top-menu {
width: 100%;
border: none;
margin: 5px 0px 0px 0px;
padding: 0;
min-height: 44px;
border-bottom: 1px solid #bbbbbb;
border-radius: 6px;
background: #5c5a5a;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#5c5a5a), to(#3d3b3b));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #3d3b3b, #5c5a5a);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #3d3b3b, #5c5a5a);
/* IE 10 */
background: -ms-linear-gradient(top, #3d3b3b, #5c5a5a);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #3d3b3b, #5c5a5a); /*box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-moz-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-o-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-ms-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);*/
vertical-align: middle;
background: #353535; /* Old browsers */
background: -moz-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #353535), color-stop(50%, #5c5a5a), color-stop(100%, #303030)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #353535 0%, #5c5a5a 50%, #303030 100%); /* IE10+ */
background: linear-gradient(to bottom, #353535 0%, #5c5a5a 50%, #303030 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#353535', endColorstr='#303030', GradientType=0 ); /* IE6-9 */
/*background:url(NEXTIT.CK.GS.WebClient/Content/images/admin-logo.png) #fff;*/
/*mask-image: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #202020 25%, #202020 75%, rgba(255, 255, 255, 0) 100%);*/
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6); /*background:white;
background:rgba(255,255,255,0.8);*/
/*filter:blur(4px);
-o-filter:blur(4px);
-ms-filter:blur(4px);
-moz-filter:blur(4px);
-webkit-filter:blur(4px);*/
}
ul.top-menu > li > a {
color: #fff;
font-weight: normal;
}
ul.top-menu > li.active {
background: #ff0000;
/* Safari 4-5, Chrome 1-9 */
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#6f0505), to(#ff0000));
/* Safari 5.1, Chrome 10+ */
background: -webkit-linear-gradient(top, #ff0000, #6f0505);
/* Firefox 3.6+ */
background: -moz-linear-gradient(top, #ff0000, #6f0505);
/* IE 10 */
background: -ms-linear-gradient(top, #ff0000, #6f0505);
/* Opera 11.10+ */
background: -o-linear-gradient(top, #ff0000, #6f0505);
outline: none;
}
ul.top-menu > li:last-child.active {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
ul.top-menu > li:first-child.active {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
ul.top-menu > li:hover {
/*background-color: #f00;*/
/*border-radius:6px;*/
/*background:rgba(255, 255, 255, 0.2);*/
cursor: pointer;
/*background: -moz-linear-gradient(top, rgba(0,0,0,0.2) 0%, rgba(255,255,255,0.5) 50%, rgba(0,0,0,0.2) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.2)), color-stop(50%,rgba(255,255,255,0.2)), color-stop(100%,rgba(0,0,0,0.2)));
background: -webkit-linear-gradient(top, rgba(0,0,0,0.2) 0%,rgba(255,255,255,0.2) 50%,rgba(0,0,0,0.2) 100%);
background: -o-linear-gradient(top, rgba(0,0,0,0.2) 0%,rgba(255,255,255,0.2) 50%,rgba(0,0,0,0.2) 100%);
background: -ms-linear-gradient(top, rgba(0,0,0,0.2) 0%,rgba(255,255,255,0.2) 50%,rgba(0,0,0,0.2) 100%);
background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%,rgba(255,255,255,0.2) 50%,rgba(0,0,0,0.2) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#33000000', endColorstr='#33000000',GradientType=0 );
-webkit-box-shadow: inset 5px rgba(0,0,0,.2), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 5px rgba(0,0,0,.2), 0 0 8px rgba(102, 175, 233, 0.6);*/
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
}
ul.top-menu > li:last-child:hover {
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
ul.top-menu > li:first-child:hover {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
ul.sub-menu {
width: 100%;
height: 100px;
border: none;
margin: 0;
padding: 0;
vertical-align: middle;
list-style: none;
display: block; /*box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-moz-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-o-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-webkit-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);
-ms-box-shadow: 2px 2px 2px rgba(0,0,0,0.40);*/
}
ul.sub-menu > li {
height: 100px;
border: none;
margin: 0;
padding: 0;
vertical-align: middle;
list-style: none;
}
ul.sub-menu > li > div {
height: 100%;
display: table;
table-layout: fixed;
border-collapse: collapse;
width: 100%;
}
ul.sub-menu > li > div > ul {
display: table-row;
}
ul.sub-menu > li > div > ul > li {
display: table-cell;
width: 100%;
border: none;
margin: 0;
padding: 0;
vertical-align: middle;
padding-left: 20px;
height: auto;
}
ul.sub-menu > li > div > ul > li > a {
text-align: left;
text-decoration: none;
height: 100%;
line-height: 100%;
display: table;
content: "";
clear: both;
vertical-align: middle;
width: 100%;
color: #101010;
font-size: 10pt;
white-space: nowrap;
text-transform: capitalize;
text-shadow: 1px 1px 1px rgba(200,200,200,0.9);
padding: 0px;
}
ul.sub-menu > li > div > ul > li > a > span {
line-height: 100%;
display: table-cell;
vertical-align: middle;
clear: both;
}
ul.sub-menu > li > div > ul > li > a > span i {
float: right;
margin-right: 14px;
content: "";
clear: both;
/*margin-top: -18px;
right: 10px;
text-align: right;*/
}
ul.sub-menu > li > div > ul > li > a:hover {
background: none;
}
ul.sub-menu > li > div > ul > li:hover {
cursor: pointer;
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 25%, rgba(255, 255, 255, 0.2) 75%, rgba(255, 255, 255, 0) 100%);
/*-webkit-box-shadow:0px 1px 1px rgba(0, 0, 0, 0.1);
-moz-box-shadow:0px 1px 1px rgba(0, 0, 0, 0.1);
box-shadow:0px 1px 1px rgba(0, 0, 0, 0.1);*/
box-shadow: 0 0 25px rgba(0, 0, 0, 0.1), inset 0 0 1px rgba(255, 255, 255, 0.6);
color: #000;
}
/*ul.sub-menu > li > div > ul > li.dropdown > ul.dropdown-menu {
top: 100%;
}*/
ul.dropdown-menu {
width: 100%;
margin: 0;
padding: 0;
}
li.dropdown:hover > ul.dropdown-menu {
display: block;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu > .dropdown-menu {
top: 0px;
left: 100%;
margin-top: -2px;
margin-left: -1px;
/*-webkit-border-radius: 0 6px 6px 6px;
-moz-border-radius: 0 6px 6px;
border-radius: 0 6px 6px 6px;*/
/*box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);*/
box-sizing: border-box;
}
.dropdown-submenu > .dropToLeft {
left: auto;
right: 100%;
top: 0px;
/*position:relative;*/
}
.dropdown-submenu:hover > .dropdown-menu {
display: block;
}
.dropdown-submenu > a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-left-color: #ccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover > a:after {
border-left-color: #fff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left > .dropdown-menu {
left: -100%;
margin-left: 10px;
-webkit-border-radius: 6px 0 6px 6px;
-moz-border-radius: 6px 0 6px 6px;
border-radius: 6px 0 6px 6px;
}
.dropdown-menu > ul > ul {
border-radius: 0px;
width: 100%;
}
.dropdown-menu > li > a {
display: block;
padding: 5px 20px;
clear: both;
font-weight: normal;
line-height: 1.42857143;
color: #101010;
font-size: 10pt;
white-space: nowrap;
text-transform: capitalize;
width: 100%;
}
.dropdown-menu > li > a:hover {
background: #ff0000;
}
.dropdown-menu > li:hover {
background: #ff0000;
}
.dropdown-menu > li {
/*box-shadow:0 1px 1px rgba(0, 0, 0, 0.1);*/
box-sizing: border-box;
border-bottom: 0.5px solid #d5d5d5;
border-top: 0.5px solid #f9f9f9;
border-radius: 0px;
width: 100%;
background: #f2f2f2;
text-align: left;
}
.dropdown-menu > ul > li > a {
/*box-shadow:0 1px 1px rgba(0, 0, 0, 0.1);*/
box-sizing: border-box;
/*border-bottom:1px solid rgba(0,0,0,0.40);
border-top:1px solid #ccc;*/
border-radius: 0px;
width: 100%;
}
.dropdown-toggle > i {
text-align: right;
right: 10px;
position: absolute;
overflow: hidden;
line-height: 1.42857143;
}
.dropdown-menu > li.manage-bar {
background: #bbbbbb;
}
.dropdown-menu > li.manage-bar a {
color: #101010;
}
.dropdown-menu > li.report-bar {
background: #bbbbbb;
}
.dropdown-menu > li.report-bar a {
color: #101010;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="" />
<meta name="author" content="" />
<script data-require="jquery#*" data-semver="2.1.1" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link data-require="bootstrap#*" data-semver="3.2.0" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.css" />
<script data-require="bootstrap#*" data-semver="3.2.0" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<nav class="navbar navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#menu-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!--<a class="navbar-brand" href="#">Brand</a>-->
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="menu-navbar-collapse-1">
<ul class="top-menu nav nav-justified">
<li class="active">HOME</li>
<li>GARMENTS</li>
<li>YARN DYEING</li>
<li>KNITTING</li>
<li>FABRIC DYEING</li>
<li>COMMON MODULES</li>
<li>GENERAL SETTING</li>
</ul>
<ul class="sub-menu nav nav-justified">
<li>
<div>
<ul>
<li class="dropdown"><span>ADMIN <span class="caret"></span></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li class="dropdown-submenu"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Manage
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
</li>
</ul>
<ul>
<li><span>HELP</span></li>
</ul>
</div>
</li>
<li>
<div>
<ul>
<li><span>HELP</span></li>
</ul>
<ul>
<li class="dropdown"><span>CHAT<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li class="divider"></li>
<li>Separated link</li>
<li class="divider"></li>
<li>One more separated link</li>
</ul>
</li>
</ul>
</div>
</li>
<li>
<div>
<ul>
<li><span>NO MENU</span></li>
</ul>
<ul>
<li><span>NO MENU</span></li>
</ul>
</div>
</li>
<li>
<div>
<ul>
<li><span>NO MENU</span></li>
</ul>
<ul>
<li class="dropdown"><span>ADMIN<span class="caret"></span></span>
<ul class="dropdown-menu" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li class="dropdown-submenu ">Manage <span class="caret"></span>
<ul class="dropdown-menu dropToLeft" role="menu">
<li>Action</li>
<li>Another action</li>
<li>Something else here</li>
<li>Separated link</li>
<li>One more separated link</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
</body>
</html>
I am trying to build a drop down menu, So far i found a really nice menu but it lists its items horizontal and displays its sub items horizontally as well.
I would like my items to be next to each other and then if it has a sub menu those items drop down.
Here is my Menu:
<link rel="stylesheet" type="text/css" href="../../Content/Menu.css" />
<div class="float-right">
<nav>
<ul class="menu" style="float: left;">
<li class="item1">Home
<ul style="display: block; ">
<li class="subitem1" >#Html.ActionLink("Home", "Index", "Home", new { #class = "active" })</li>
<li class="subitem2">#Html.ActionLink("Contact", "Contact", "Home")</li>
<li class="subitem3">#Html.ActionLink("About", "About", "Home")</li>
</ul>
</li>
<li class="item2">#Html.ActionLink("Login", "Login", "Home")</li>
</ul>
</nav>
</div>
Style Sheet
body {
font-size: 100%;
background:#32373d;
}
a {
text-decoration: none;
}
ul, ul ul {
margin: 0;
padding: 0;
list-style: none;
}
#wrapper {
width: 220px;
margin: 100px auto;
font-size: 0.8125em;
}
.menu {
width: 225px;
height: auto;
-webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13);
-moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13);
box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13);
}
.menu > li > a {
background-color: #616975;
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(114, 122, 134)),to(rgb(80, 88, 100)));
background-image: -webkit-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100));
background-image: -moz-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100));
background-image: -o-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100));
background-image: -ms-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100));
background-image: linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#727a86', EndColorStr='#505864');
border-bottom: 1px solid #33373d;
-webkit-box-shadow: inset 0px 1px 0px 0px #878e98;
-moz-box-shadow: inset 0px 1px 0px 0px #878e98;
box-shadow: inset 0px 1px 0px 0px #878e98;
width: 100%;
height: 2.75em;
line-height: 2.75em;
text-indent: 2.75em;
display: block;
position: relative;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 600;
color: #fff;
text-shadow: 0px 1px 0px rgba(0,0,0,.5);
}
.menu ul li a {
background: #fff;
border-bottom: 1px solid #efeff0;
width: 100%;
height: 2.75em;
line-height: 2.75em;
text-indent: 2.75em;
display: block;
position: relative;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 0.923em;
font-weight: 400;
color: #878d95;
}
.menu ul li:last-child a {
border-bottom: 1px solid #33373d;
}
.menu > li > a:hover, .menu > li > a.active {
background-color: #35afe3;
background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(69, 199, 235)),to(rgb(38, 152, 219)));
background-image: -webkit-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219));
background-image: -moz-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219));
background-image: -o-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219));
background-image: -ms-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219));
background-image: linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219));
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#45c7eb', EndColorStr='#2698db');
border-bottom: 1px solid #103c56;
-webkit-box-shadow: inset 0px 1px 0px 0px #6ad2ef;
-moz-box-shadow: inset 0px 1px 0px 0px #6ad2ef;
box-shadow: inset 0px 1px 0px 0px #6ad2ef;
}
.menu > li > a.active {
border-bottom: 1px solid #1a638f;
}
.menu > li > a:before {
content: '';
background-image: url(../images/sprite.png);
background-repeat: no-repeat;
font-size: 36px;
height: 1em;
width: 1em;
position: absolute;
left: 0;
top: 50%;
margin: -.5em 0 0 0;
}
.item1 > a:before {
background-position: 0 0;
}
.item2 > a:before {
background-position: -38px 0;
}
.item3 > a:before {
background-position: 0 -38px;
}
.item4 > a:before {
background-position: -38px -38px;
}
.item5 > a:before {
background-position: -76px 0;
}
.menu > li > a span {
font-size: 0.857em;
display: inline-block;
position: absolute;
right: 1em;
top: 50%;
background: #48515c;
line-height: 1em;
height: 1em;
padding: .4em .6em;
margin: -.8em 0 0 0;
color: #fff;
text-indent: 0;
text-align: center;
-webkit-border-radius: .769em;
-moz-border-radius: .769em;
border-radius: .769em;
-webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15);
-moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15);
box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15);
text-shadow: 0px 1px 0px rgba(0,0,0,.5);
font-weight: 500;
}
.menu > li > a:hover span, .menu > li a.active span {
background: #2173a1;
}
.menu > li > ul li a:before{
content: '▶';
font-size: 8px;
color: #bcbcbf;
position: absolute;
width: 1em;
height: 1em;
top: 0;
left: -2.7em;
}
.menu > li > ul li:hover a,
.menu > li > ul li:hover a span,
.menu > li > ul li:hover a:before {
color: #32373D;
}
.menu ul > li > a span {
font-size: 0.857em;
display: inline-block;
position: absolute;
right: 1em;
top: 50%; /
background: #fff;
border: 1px solid #d0d0d3;
line-height: 1em;
height: 1em;
padding: .4em .7em;
margin: -.9em 0 0 0;
color: #878d95;
text-indent: 0;
text-align: center;
-webkit-border-radius: .769em;
-moz-border-radius: 769em;
border-radius: 769em;
text-shadow: 0px 0px 0px rgba(255,255,255,.01));
}
What property in my style sheet is causing my Menu to list like this?
Is there a way to override what every is causing the menu you to do this?
Edit
Html list:
<div class="float-right">
<nav>
<ul class="menu" style="float: left;">
<li class="item1">Home
<ul style="display: block; ">
<li class="subitem1" ><a class="active" href="/?Length=4">Home</a></li>
<li class="subitem2">Contact</li>
<li class="subitem3">About</li>
</ul>
</li>
<li class="item2">Login</li>
</ul>
</nav>
</div>
.menu {
width: 225px;
}
the width:225px prevents the menu from displaying correctly.
http://jsfiddle.net/wFyMs/2/
Why can you make it simplier?
Try rewrite it by this pattern:
CSS
li { float: left; }
li ul li { clear: both; }