Change your style from:
#navlink .tmargin{
padding-bottom: 6px;
padding-left: 10px;
}
to:
#navlink .tmargin{
padding-bottom: 6px;
margin-left: 10px;
display:block;
}
The display:block enables your 'a' tags to be block level elements, which will then respect the padding styles you've added.
-monolith
Main Topics
Browse All Topics





by: ljo8877Posted on 2006-03-03 at 15:24:39ID: 16099625
Well, you didn't provide th HTML, which is significant. So I'll assume this is the HTML
p; &n bsp; text4</a>
<div id=navlink>
<a href="page1.html" class="tmargin">text1</a>
<a href="page2.html" class="tmargin">text2</a>
<a href="page3.html" class="tmargin">text3</a>
<a href="page4.html" class="tmargin">text4</a>
<!-- This line is needed for option 1 below -->
<div style="height: 1px; clear: left;"> </div>
</div>
Padding doesn't apply to inline elements only block elements. This gives you two options
1. make the link a block element
#navlink .tmargin{
display: block; /* make padding and margins apply */
float: left; /* get them all on 1 line again */
padding-bottom: 6px;
padding-left: 10px;
}
2. Adjust the height with line-height
#navlink .tmargin{
line-height: 2;
}
and us nonbreaking spaces for the left padding
<a href="page4.html" class="tmargin"> &nbs