This is something that's been bugging me ever since I've gotten into lightweight CSS-based designs. I'm sure it's a silly question with an obvious answer, but whatever that solution is, it hasn't come to me and Google has not been my friend:
What I want to do is have a standard page layout with several paragraphs seperated by various header tags along with, say, a floating DIV or IMG over on the right. My problem comes when I try to give the H tag a border--for example, a bottom border on an H2 to create a line across the page breaking it up better. Works great unless the float happens to be beside the H tag--then, since the H tag's block-level box extends all the way to the right edge of the containing element, the line goes under (or over, depending) the float, even though the contained text wraps.
An obvious solution is to set the clear property for the H tag and prevent it from being beside the float, but that can cause some big gaps in the page, and I'd rather just have the underline extend to the floating object's margin, but no further.
Is there some obvious way to do this, or am I trying to fit a square peg into a round hole?
What I want to do is have a standard page layout with several paragraphs seperated by various header tags along with, say, a floating DIV or IMG over on the right. My problem comes when I try to give the H tag a border--for example, a bottom border on an H2 to create a line across the page breaking it up better. Works great unless the float happens to be beside the H tag--then, since the H tag's block-level box extends all the way to the right edge of the containing element, the line goes under (or over, depending) the float, even though the contained text wraps.
An obvious solution is to set the clear property for the H tag and prevent it from being beside the float, but that can cause some big gaps in the page, and I'd rather just have the underline extend to the floating object's margin, but no further.
Is there some obvious way to do this, or am I trying to fit a square peg into a round hole?