I have an h3 tag that runs onto a second line. The h3 has a style of padding-left: 5px, but the second line extends back outside of that 5px padding. Is there an easy fix for this?
| SitePoint Sponsor |
I have an h3 tag that runs onto a second line. The h3 has a style of padding-left: 5px, but the second line extends back outside of that 5px padding. Is there an easy fix for this?
Can you show us? Sounds a bit odd.





Hi,
Is it only happening in IE? Try giving the h3 layout if it is:
Some code or s link would probably help if that doesnt workCode:/* mac hide \*/ * h3 {height:1%} /* end hide*/
Ahhah! I figured it out. This page is using inline styles (I know, I know)...
The code was this:
As you can see, the padding-left was applied to the anchor tag, not the h3. So I fixed that.HTML Code:<div class="contentsection"> <h3><a href="#" style="color:#003273; text-decoration:none; padding-left: 5px;">Title of section</a></h3> <p style="padding-left:5px;">Paragraph info... blah blah blah...</p> <p style="padding-left:5px;"><a href="#">Read More > </a></p> </div>
Now I have:
HTML Code:<div class="contentsection"> <h3 style="padding-left: 5px;"><a href="#" style="color:#003273; text-decoration:none;">Title of section</a></h3> <p style="padding-left:5px;">Paragraph info... blah blah blah...</p> <p style="padding-left:5px;"><a href="#">Read More > </a></p> </div>
Bookmarks