Reputation: 19
The problem I'm having is coming from the topnav leftside with the buttons. For whatever reason it seems they have a bullet point or something in them cause it to have a space and then the word (home,about,etc) and also its not floating all the way to left by the wrapper div.
<nav id = topnav>
<ul class = leftside>
<li>Home</li>
<li>About</li>
<li>Photos</li>
<li>Articles</li>
<li>Forum</li>
<li>Contact</li>
</ul>
<ul class = rightside>
<li><a href="https://facebook.com/" target="_blank"><img src="images/facebook.png"/></a></li>
<li><a href="https://twitter.com/" target="_blank"><img src="images/twitter.png" /></a></li>
<li><a href="https://instagram.com/" target="_blank"><img src="images/instagram.png" /></a></li>
<li><a href="https://youtube.com/" target="_blank"><img src="images/youtube.png"/></a></li>
</ul>
</nav>
and the CSS portion:
#topnav {
clear: both;
}
#topnav .leftside li{
text-decoration: none;
color: black;
background-color: #DCCBCB;
box-shadow: 5px 5px 5px gray;
margin-bottom: 2px;
text-align: center;
display: inline; font-family: helvetica; font-size:16px; margin: 5px;
float: left;
padding-left: 2%;
margin: 0px 20px;
list-style: none;
}
#topnav .leftside li:hover {
background-color: #595454;
box-shadow: 5px 5px 5px gray;
border: none;
color: white;
}
#topnav .rightside li {
display: inline;
float: right;
padding-right: 2%;
}
Upvotes: 0
Views: 67
Reputation: 2750
You probably have a white space between your inline li.
Try this:
ul
{
font-size: 0;
}
ul li
{
display: inline;
font-size: 16px; /* or whatever size you need */
}
Upvotes: 0
Reputation:
Is this what you need?
ul {
display: inline;
list-style: none;
margin: 0;
padding: 0;
}
li {
display: inline;
}
.rightside {
float: right;
}
JSFiddle: http://jsfiddle.net/LDG7U/
Upvotes: 2