css element within element....

T

Travis Newbury

Barbara said:
In the hierarchy alt.* anything goes for sure. In a named group, like alt.html,
there are things on topic and off topic. If anything goes, how about a
discussion on fuel shortage in the coming decade?
Probably already been discussed here.
 
E

Els

Barbara said:
Come again? Using the '>' in a style selector means the
author wants all direct decendents, also know as
'children' to render with a specific style. Thus the '>'
in a selector creates a child selector. It is only if the
spaces are left out, 'foo>bar' instead of 'foo > bar' (that
gets mis-interpreted by IE), that the styles for the
selector are ignored by a certain obscure and faulty
browsers aka as IE :) . Knowing that, might seduce a
webauthor into using the child selector without spaces as a
'hack to get different browsers do different things'. But
that certainly was not the intended use for the child
selector.

I thought that foo > bar was treated by IE as foo bar.
Thus making a difference in behaviour between IE and the other
browsers. Am I wrong?

Yes, I knew that foo>bar gets ignored completely by IE, and
yes, of course I know that foo > bar and foo>bar were never
intended as hacks.
In practice these days they are though, as you can't use
either of them for cross-browser styles.
 
J

JDS

I thought that foo > bar was treated by IE as foo bar. Thus making a
difference in behaviour between IE and the other browsers. Am I wrong?

Yes, I knew that foo>bar gets ignored completely by IE, and yes, of course
I know that foo > bar and foo>bar were never intended as hacks.
In practice these days they are though, as you can't use either of them
for cross-browser styles.

Just because MSIE treats foo > bar wrong does not make it a hack to get
browsers to do different things.

And what is the difference between "foo>bar" and "foo > bar"? IMO, none.
I'm pretty sure MSIE will ignore both, and other browsers will treat it
correctly.

Example (and I tested the it with and without space around ">"):

Space around ">":
<http://newtnotes.com/exercises/css.html>

No space around ">":
<http://newtnotes.com/exercises/css2.html>

Try it in MSIE and FireFox and Opera and Konqueror.
 
J

JDS

In the hierarchy alt.* anything goes for sure. In a named group, like
alt.html, there are things on topic and off topic. If anything goes, how
about a discussion on fuel shortage in the coming decade?

How about we start marking these divergent threads as OT, people?
 
D

Dylan Parry

JDS said:
And what is the difference between "foo>bar" and "foo > bar"? IMO, none.
I'm pretty sure MSIE will ignore both

Nope. Try this:

div > span {
color: red;
}

Then add this to your HTML:

<div><span>this is red</span></div>
<div><p><span>this is *not* red</span></p></div>

Internet Explorer will screw up and render both spans in red because it
*ignores* the child selector and treats the CSS as being a descendant
selector instead.

Now try the same but with:

div>span {
color: red;
}

IE renders neither spans in red.
 
E

Els

JDS said:
Just because MSIE treats foo > bar wrong does not make it a
hack to get browsers to do different things.

I think I'm allowed to use it as a hack to let IE do stuff
different than the rest of the browsers.
And what is the difference between "foo>bar" and "foo >
bar"? IMO, none. I'm pretty sure MSIE will ignore both,
and other browsers will treat it correctly.

No, MSIE takes "foo > bar" as "foo bar".
Example (and I tested the it with and without space around
">"):

Space around ">":
<http://newtnotes.com/exercises/css.html>

No space around ">":
<http://newtnotes.com/exercises/css2.html>

Try it in MSIE and FireFox and Opera and Konqueror.

Look in MSIE 5.01: there the green border does show up,
although the orange background doesn't.

A bit of checking reveals that MSIE 5.01 reads ".foo > .bar"
as ".bar". It gives the second div.bar the same border.

Not good if you only wanted direct children of an element to
pick up a style.

And I'm sure there is some version of IE (or maybe a different
browser?) that treats "foo > bar" as "foo bar".
Personally, I really only use it as a hack.
 
T

Toby Inkster

rf said:
Note the absense of "alt" in ciwas.
alt means alternative.

Yes, but it doesn't mean "alternative content" or "alternative discussion".

The existing newsgroup hierarchies required lengthy voting systems to
create a new group (and they still do), so "alt" was created as an
alternative to all that. Anybody can create a newsgroup instantly. (Of
course, just because you create it, doesn't mean any servers will carry it!)

So that's it -- it's an alternative system for managing newsgroups -- not
a system of alternative newsgroups. We don't have to sit around listening
to The Cure all day.
 
J

JDS

Now try the same but with:

div>span {
color: red;
}
}
IE renders neither spans in red.

I see.

Well, either way, my example also demonstrates something about something.
MSIE not doing something right or something like that.
 
W

WindAndWaves

Barbara de Zoete said:
What was the original logic of creating a newsgroup ciwas? Why shouldn't a
discussion on styles, selectors et cetera be better of there?

ciwas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top