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 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2011
    Posts
    27
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Usage of semi-colon and !important?

    Do I have to put a semi-colon between the attribute and the "!important"?

    In other words is

    #header { margin-bottom: 5px; !important; }

    and

    #header { margin-bottom: 5px !important; }

    the same?

    2.) Do I have to put an !important after every attribute if I want to make them all important
    or does one final !important apply to ALL previous attributes in the same line?

    In other words is:

    .text { font-size: 16px; line-height: 18px; !important; }

    and

    .text { font-size: 16px; !important; line-height: 18px; !important; }

    the same?

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    1) no semi-colon in between
    2) You need a new !important for every rule

    http://coding.smashingmagazine.com/2...hen-to-use-it/

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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