What does this mean?

  • Thread starter Paul F. Johnson
  • Start date
P

Paul F. Johnson

Hi,

I've been looking at a style sheet and it has something which has
perplexed me - can anyone shed any light on what it means?

#outer {
text-align: left; width: 100%; height: 500px
}

/* for Opera */

html > body #outer {
width: auto;
}

I've seen this sort of thing (html > body) quite a few times on different
style sheets, but have never understood what it did.

TTFN

Paul
 
B

brucie

in post <Paul F. Johnson said:

I've been looking at a style sheet and it has something which has
perplexed me - can anyone shed any light on what it means?

#outer {text-align: left; width: 100%; height: 500px}
/* for Opera */
html > body #outer {width: auto;}

I've seen this sort of thing (html > body) quite a few times on different
style sheets, but have never understood what it did.

a '>' is a child selector
http://www.w3.org/TR/REC-CSS2/selector.html#child-selectors

they're usually used to hide CSS from browsers that have problems with
the css. http://www.w3development.de/css/hide_css_from_browsers/child/

for browsers that /have/ a problem understanding the CSS apply this CSS
to the element with the #outer ID:

#outer {text-align:left;width:100%;height:500px}

for browsers that /don't have/ a problem understanding the CSS use '>'
to hide the change in CSS from that browser and use this instead on the
element with the #outer ID:

html > body #outer {width:auto;}
 

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,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top