CSS Syntax

T

Trevor L.

Maybe a bit OT as it is a CSS question

I have seen CSS styles like
A*B
(I can't recall an example)
A>B
e.g html>body

What does this syntax mean ?
 
M

Murray

A>B means any occurence of B that is a child of A. In other words -

<A>
.....
<B></B>
....
</A>

but not -

<body>
<B>...</B>

A*B would refer to any construction that has B as a GRANDCHILD of A, e.g.,

<A>
....
<C>
....
<B></B>
....
</C>
....
</A>

but not when B is a closer descendent to A, e.g.,

<A>
....
<B></B>
....
</A>

There are also adjacent-sibling selectors -

A+B

which would select any occurrence of A immediately followed by B.

Support for all of these selctor usages is incomplete at present....
 
T

Trevor L.

Murray wrote:
[snip of some interesting explanations]

So we have
A>B any occurence of B that is a child of A.
A*B any construction that has B as a GRANDCHILD of A
A+B any occurrence of A immediately followed by B.

I searched w3schools and couldn't find any reference to this.

Is it valid for modern browsers, say IE6 (if you call that modern !) and
Firefox 1.5 >
 
S

Stefan B Rusynko

See
http://www.w3.org/TR/REC-CSS2/selector.html

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Murray wrote:
| [snip of some interesting explanations]
|
| So we have
| A>B any occurence of B that is a child of A.
| A*B any construction that has B as a GRANDCHILD of A
| A+B any occurrence of A immediately followed by B.
|
| I searched w3schools and couldn't find any reference to this.
|
| Is it valid for modern browsers, say IE6 (if you call that modern !) and
| Firefox 1.5 >
| --
| Cheers,
| Trevor L.
| Website: http://tandcl.homemail.com.au
|
|
 

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

Top