Thanks Bert,

I had a feeling someone was going to reply with that suggestion, and you're right :) The whole test case I setup was merely to display the point that the hr element was no cooperating with the negative margins. I'm hoping more specifically for an explanation on why that is, not on how to get the desired effect.

Bert Doorn wrote:

G'day


I've setup a test case for the issues I'm having:
http://www.epiphanize.com/NegativeMarginsTest.htm

You'll notice both the hr and h1 "separators" work nicely in FF, and only the h1 works in IE while the hr doesn't want to cooperate.


If the hr is only there for decorative purposes (i.e. no semantic meaning), why not put 0 padding on the container and apply the padding (and border-top or border-bottom) to the paragraphs instead? No need for the hr element or negative margins that way.

CSS along these lines:

#Container {
    padding: 0;
    border: 1px solid #999;
}
#Container h1 {
    background-color:#999;
        font-size:1.5em;
        margin:0;
    padding:.6em;
}
#Container p {
        margin:0;
        padding:1em .8em;
        border-top:1px solid #999;
}

Regards



******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************

Reply via email to