1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: CSS Operator ('>') Question

Discussion in 'Web Design & Development' started by pcpro17, Jul 17, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. pcpro17

    pcpro17 Thread Starter

    Joined:
    Oct 9, 2006
    Messages:
    469
    Hello. I've seen this operator ('>') used in various CSS sheets on the web, but I'm having a little trouble finding documentation on it. Does anyone know what '>' (greater than sign) is supposed to do in CSS? Thanks! :D
     
  2. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    It means parent/child

    example:

    html>body

    that's saying that body is a child of html, which is true as you will see here:

    Code:
    <html>
       <body>
       </body>
    </html>
    (body is the child because it's wrapped within html tags)

    However, some browsers like IE6 (not sure about IE7) don't understand '>' very well, if at all.
     
  3. pcpro17

    pcpro17 Thread Starter

    Joined:
    Oct 9, 2006
    Messages:
    469
    Thanks, that's very helpful! But, how is
    Code:
    <style>html > body { ... }</style>
    different from
    Code:
    <style>html body { ... }</style>
    ?
     
  4. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    Well they mean slightly different things, however they have almost the same effect.

    Since IE doesn't understand '>' too well, most everyone just uses the second example anyway. That is: html body {...}

    If you wanna know everything W3C has to say about CSS, give this page a look:
    http://www.w3.org/Style/CSS/
     
  5. pcpro17

    pcpro17 Thread Starter

    Joined:
    Oct 9, 2006
    Messages:
    469
    Thanks for the clarification! :D
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/596886

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice