I have the following html code:
<ul>
<li><a href="#">Home</a></li>
<li><a href="">About Us</a></li>
<li><a href="">Services</a></li>
<li><a href="">Portfolio</a></li>
<li><a href="">Blog</a></li>
<li><a href="">Contact</a></li>
</ul>
And the following styles:
li {
display: inline;
list-style: none;
margin: 0px 7px;
}
li a {
text-decoration: none;
}
I do it for my navigation bar. This style nicely position my links in the following order:
Home About Us Services ...
They are all inline because of the li html tag which was styled to be inline element. Now if I change achor syle ot be like this:
li a {
text-decoration: none;
display: block;
}
I made anchors to be block elements. Suddenly my links will look like this:
Home
About Us
Services
...
They become separated by line brakes. But each anchor was contained in li element, which was made inline. Do you know why this happens?