By Adam Roberts

border-bottom (CSS property)

By Adam Roberts
Help us help you! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min


border-bottom: { [ border-width ] [ border-style ] [ border-color ] | inherit } ;


The border-bottom shorthand property sets border-bottom-width and/or border-bottom-style and/or border-bottom-color to the bottom side of an element simultaneously.

Borders are placed on top of the element’s background.



This style rule assigns a 2px blue border to the bottom side of paragraphs within the element with ID "example":

#example p {
  border-bottom: 2px solid blue;


Refer to the following individual properties for specific information on allowed and initial values: border-width, border-style, and border-color.

Negative length values are illegal.

As with most shorthand properties, you don’t need to specify all the properties listed, but any omitted properties will revert to their default values. In the case of border-style, if you omit a value no border will show at all, because the default value is none. A border will only be visible as long as the border-style property has been set to something other than none or hidden, or has been restated explicitly after the initial shorthand declaration. Otherwise, no border will show and the border-width will be reset to zero. Therefore, its good practice to specify a value for the border’s style when you’re using shorthand notation.

Login or Create Account to Comment
Login Create Account
Get the latest in Front-end, once a week, for free.