I have a side nav bar and I have set the float to be right and then when I put the position: fixed; it floated to left why did this happen? can anyone help me?
this is my html:
<div id="navbar">
<ul>
<li><a href="default.asp"> <i class="fa fa-pagelines fa-2x"></i></a></li>
<li><a href="news.asp"> <i class="fa fa-smile-o fa-2x"></i></a></li>
<li><a href="contact.asp"> <i class="fa fa-envelope-o fa-2x"></i></a></li>
<li><a href="about.asp"> <i class="fa fa-home fa-2x"></i></a></li>
<li><a href="default.asp"> <i class="fa fa-plus-square fa-2x"></i></a></li>
<li><a href="news.asp"> <i class="fa fa-bell-o fa-2x"></i></a></li>
<li><a href="contact.asp"> <i class="fa fa-cog fa-2x"></i></a></li>
<li><a href="about.asp"> <i class="fa fa-clock-o fa-2x"></i></a></li>
<li><a href="about.asp"> <i class="fa fa-power-off fa-2x"></i></a></li>
</ul>
</div>
And this is my css:
#navbar{
position:fixed;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
height:auto;
width: 70px;
background: rgba(255, 255, 255, 0.1);
float:right;
}
li a {
display: block;
color: #ffffff;
padding: 22.2px 10px;
text-decoration: none;
-webkit-transition: all 0.5s ease;
transition: all 0.5s ease;
-webkit-appearance: none;
}
li a:hover,li a:focus {
background-color:#28a828;
color: green;
}
Thank you :)
Aucun commentaire:
Enregistrer un commentaire