Reputation: 143
I have some issues with icon images in navigation bar, I tried to set these icons in correct positions besides each label. If you find web label is very closed to computer monitor icon, I try to change padding top and bottom except left and right but doesn't work that way.
http://i58.tinypic.com/e5i7p4.jpg
<nav id="sideMenu" role="navigation">
<ul id="MainNav" class="nav-bar">
<li><a class="icon" href="#web"><img src= "img/web.svg">Web</a></li>
<li><a class="icon" href="#articles"><img src= "img/articles.svg">Articles</a></li>
<li><a class="icon" href="#about"><img src= "img/about.svg">About</a></li>
<li><a class="icon" href="#contact"><img src= "img/contact.svg">Contact</a></li>
</ul>
</nav>
.icon img {
height: 30px;
width: 30px;
padding-left: -0.2rem;
padding-right: 0.8rem;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
anyone please?
Upvotes: 0
Views: 1550
Reputation: 26
Try to use margin. Padding is for text. You can try this -
.icon img {
height: 30px;
width: 30px;
margin: 3px 0px 0px -6px;
}
Upvotes: 1