Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How should one use borders?

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40519
    balaji_sr
    Participant

    I have few doubts regarding borders in CSS,

    **1. Can width, style and color can be presented in random order?**
    like this:

    border: white 5px dotted;

    **2. What is the default width, style and color of borders? Is it compulsory to present all the three properties?**

    #112922

    To address your first question: the order doesn’t matter. See here: http://jsfiddle.net/joshnh/3aq2n/

    Secondly, the only value required is the border-style, as it is none by default. If you don’t set the colour or the width, then the defaults will be used. The default value of the border-color is equal to the color property, and the default value of the border-width is medium. See here: http://jsfiddle.net/joshnh/njzyv/

    Also, for further reading, check this out: http://www.w3.org/TR/CSS2/box.html#border-properties

    #112923
    neerukool
    Participant

    The default border-width which is medium equals 3px.
    And all the juggling you specify for border are true for ‘outline’ also.

    #112924
    balaji_sr
    Participant

    Thank you. this really helped me!

    #112890

    You’re welcome!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.