sibling selectors in css
hey all.
okay i'm trying to learn this stuff... can Anyone tell me why this code doesnt' work in IE!?! it works fine in Opera & Mozilla & NS 6 but not EI 5.5 or 6
<html>
<head>
<STYLE TYPE="text/css">
H1 { font-size: xx-large };
H2 { font-size: x-large };
H1 + H2 { font-size: small };
P + P { text-indent: 2em }
</STYLE>
</head>
<body>
<H1>first title xx-large</H1>
<P>This is a P - he he he.. stupid P isn't cooperating</P>
<p>This paragraph is the 2nd so it should theoretically indent 2em</p>
<p>this stupid paragraph isn't indenting!!!</p>
<H2>this is the second title x-large</H2>
<P>trying the tags inside eachother</P>
<H1>H1</H1>
<H2>this isn't small like it should be :(</H2>
</body>
</html>
thx
~nina
zollet posted this at 15:09 — 27th June 2002.
He has: 1,016 posts
Joined: May 2002
Umm.. Hmm........ Where did you get that from?
Try this..
<STYLE TYPE="text/css">
H1 { font-size: xx-large; }
H2 { font-size: x-large; }
P { text-indent: 2em; }
</STYLE>
ktown posted this at 15:15 — 27th June 2002.
They have: 34 posts
Joined: May 2001
well no..
i know that works.. but the whole thing is
P + P mean every P BUT the 1st will indent
and H1 + H2 means that only H2s that are directly after H1's will be small as opposed to the rest which will be x-large..
its the whole sibling conepts.. try it in NS 6 or Mozilla or Opera and you will see what it is supposed to do..
the only browser it won't work in is EI (and NS 4.x) and thats seems odd
disaster-master posted this at 17:33 — 27th June 2002.
She has: 2,154 posts
Joined: May 2001
Doesn't that seem a little complicated? Why don't you just use H1, H2 and an H4 or H5? Much easier IMO and it will even look good with style sheets turned off.
It may be out there somewhere but I wasn't able to find anything on h1+h2????????
Ahh Haaa!
Here it is.http://www.richinstyle.com/guides/advanced2.html
And it says that "These aren't supported by most browsers, and aren't nearly as useful as descendant combinators"
Suzanne posted this at 22:04 — 27th June 2002.
She has: 5,507 posts
Joined: Feb 2000
Yes, IE doesn't do p+p.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.