My side nav bar has a strange behavior. I set the float to be right and then added position: fixed; but it suddenly floated to the left. Can anyone explain why this happened?
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 here's 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 :)