SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Css 2

  1. #1
    ********* Shroom mydster's Avatar
    Join Date
    Nov 2002
    Location
    tpyge
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Css 2

    A few questions:

    What does '!important' mean in CSS? Example:
    div#sidebar a, div#sidebar p, div#sidebar form {
    border-width: 0 1px 0 0 !important; margin: 0 2px;}

    What does it mean when there is a '>' sign in a CSS attribute?

    Thanks.

  2. #2
    SitePoint Enthusiast abbey's Avatar
    Join Date
    Apr 2003
    Location
    Chicago
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well !important means it's important

    Seriously, that means that no matter what, this is what you want. That way it can't be accidentally overridden by another style declaration. To get it to work it must be the last thing in the rule.

    So, all h1's should be blue -- h1 {color : Blue !important;} means someone can't come along later and do h1 style="color: green;"

    The symbol there denotes a child so that p > em {color : purple;} means only those instance of the em tag within a p tag will be purple.
    <abbey />
    HTML/XHTML/CSS coding
    Abbey Ink

  3. #3
    ********* Shroom mydster's Avatar
    Join Date
    Nov 2002
    Location
    tpyge
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much abbey!

    Also, that was a very quick response. Many thanks.

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Also, !important will override any user-set stylesheets (i.e. Opera and Mozilla users can create their own stylesheets, in order to do things their way, i.e. disabling flash, putting thick borders around links that open in new windows, etc). However, if in the user style sheet they in turn specify "!important", their settings will most likely override yours.

  5. #5
    SitePoint Enthusiast abbey's Avatar
    Join Date
    Apr 2003
    Location
    Chicago
    Posts
    89
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mydster
    Thank you so much abbey!

    Also, that was a very quick response. Many thanks.
    You're welcome -- I'm new here, enthusiastic, eager and currently between projects.

    With any luck, I'll disappear for a bit soon (IOW, get another paying job).
    <abbey />
    HTML/XHTML/CSS coding
    Abbey Ink


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
  •