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 4 of 4
  1. #1
    New Coder
    Join Date
    Feb 2009
    Location
    Norway, Europe
    Posts
    94
    Thanks
    12
    Thanked 2 Times in 2 Posts

    {border: 1px solid black} or {border: 1px black solid}

    I'm used to
    Code:
    border: 1px solid black
    but then I saw
    Code:
    border: 1px black solid
    in a tutorial, and I started wondering. Which one is best?

  • #2
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Code:
    border: 1px solid black;
    is it (read here). If you think about it in a conversational sense it helps to remember. If I saw a black car I wouldn't say to my friend, "That car is black solid;" I would say, "That car is solid black."

    For even more precision use the hex code:

    Code:
    border: 1px solid #000
    (written using hex code shorthand)

    This is especially important when using colors like "light green" or some such, which may not be consistent cross-browser. With the hex codes you know you'll see the same thing everywhere.
    matt | design | blog

  • Users who have thanked BoldUlysses for this post:

    DarkLightA (02-25-2009)

  • #3
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The specification for CSS 2.1 doesn't explicitly state they have to be in a certain order but they are listed like your first example.

    http://www.w3.org/TR/CSS21/box.html#...and-properties
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #4
    New Coder
    Join Date
    Feb 2009
    Location
    Norway, Europe
    Posts
    94
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Wow, VERY fast replies!

    Yea, msuffern, that's what I thought too; it was very logical.

    Thanks again to both of you


  •  

    Posting Permissions

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