Forum Moderators: not2easy
I'm trying to increase the padding for all 'p' elements that are 'childs' of a h3 element (or is that 'siblings'?).
so I have some lines of text like:
<h3>Header 3</h3>
<p>This is a test</p>
<p>This is a test</p>
<p>This is a test</p>
<p>This is a test</p>
And *all* of the paragraphs following that 'h3' element should have extra padding.
In firefox, following CSS seems to work:
#stage h3+p, #stage h3+p+p, #stage h3+p+p+p, #stage h3+p+p+p+p {
padding-left: 10px;
}
But in Internet Explorer (6.0), it doesn't do anything at all.
Which selectors/which method can I use to obtain this result in IE?
h3 ~ p { padding-left: 10px; } IE6 lacks support for nearly all selectors, but IE7 and some other browsers (including Firefox and Opera) support this.
If this is a special case you could wrap the contents in a div with an id or class then write your rule to be:
div#my_div p { padding-left: 10px; }
Unfortunately, it's a pattern that appears on many, many webpages of the site...
I wish all browsers would already support CSS3! :¦
[edited by: Darkelve at 12:29 pm (utc) on Aug. 29, 2006]
I suppose the alternative is to specify your padding left for all <p>s and special case the others? Not ideal.
Maybe you could just ignore IE6 and lower? :)