Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS !Important Validation Error

    Hi,

    Can anyone tell me why this:

    padding:6px !important 15px !important 6px !important 15px !important

    doesn't validate?

    It's the last line of code, so doesn't need the semi-colon and it is followed by a curly brace.

    It's now 4.47 in the morning and I am going crazy trying to see what the problem is!

    Thanks.

    Fogey

  • #2
    Regular Coder Candygirl's Avatar
    Join Date
    Apr 2008
    Location
    Switzerland
    Posts
    183
    Thanks
    3
    Thanked 56 Times in 56 Posts
    In css 2.1 candidate recommendation:
    Declaring a shorthand property (e.g., 'background') to be "!important" is equivalent to declaring all of its sub-properties to be "!important
    You should write:

    Code:
    padding:6px 15px 6px 15px !important
    "Imagination was given to man to compensate for what he is not;
    a sense of humour to console him for what he is."
    -Francis Bacon

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    !important can't be used more than once inside a rule.
    You have to write it like
    Code:
    padding:6px 15px 6px15px !important
    Or
    simply
    Code:
    padding:6px 15px !important
    BTW, what's your need to apply a padding like this? There might be some other issues in your CSS/layout, and fixing of this may enable you to remove the above rules.

    Could you post a link?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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