SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    asking explanation for style code

    Quote Originally Posted by Paul O'B
    * html #header {height:70px}

    Would you rephrase it in English?
    What does "asterisk(*)" mean here?

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    * means the root element of a document. In the case of HTML and XHTML, it's the <html> element. That code really means "look for #header inside of an html element inside the root element of the document".

    Now you might be saying "That doesn't make sense! <html> will never be inside of <html>!" Well, you're right, but IE isn't and will apply the style as if the asterisk wasn't in that selector, while all other browsers will apply it properly (meaning they won't apply the style to anything).

  3. #3
    Non-Member Egor's Avatar
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    7,305
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Great examplanation, I always wondered what it actually meant.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    As Vinnie syas in the above example * means the root element but just in case anybody thinks that's what it always mean then I might just add this:

    * = universal selector and is like a wildcard that means it stands for any and every element that could be put in its place.

    e.g.

    body div * p {color:black}

    This would match any paragraphs that are grandchildren of the div. It would not match paragrpahs that are children of the div.

    For more info have a look here:

    http://www.meyerweb.com/eric/article...v/200006a.html

    and for the sbmh have a look here:

    http://www.info.com.ph/~etan/w3panth...ifiedsbmh.html

    Paul


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •