CSS: border-bottom-width property
This CSS tutorial explains how to use the CSS property called border-bottom-width with syntax and examples.
Description
The CSS border-bottom-width property defines the width of the bottom border of a box.
Syntax
The syntax for the border-bottom-width CSS property is:
border-bottom-width: value;
Parameters or Arguments
- value
The width of the bottom border of a box. It can be one of the following:
Value Description fixed Fixed value expressed in px, em, ...
div { border-bottom-width: 2px; }thin Thin border width, which might be 1px or 2px depending on the browser
div { border-bottom-width: thin; }medium Medium border width, which might be 3px or 4px depending on the browser
div { border-bottom-width: medium; }thick Thick border width, which might be 5px or 6px depending on the browser
div { border-bottom-width: thick; }
Note
- Be sure to set the border-bottom-style property as well to make sure that your bottom border appears.
- See also the border-bottom-color, border-bottom-style, and border-bottom properties.
Browser Compatibility
The CSS border-bottom-width property has basic support with the following browsers:
- Chrome
- Android
- Firefox (Gecko)
- Firefox Mobile (Gecko)
- Internet Explorer (IE)
- IE Phone
- Opera
- Opera Mobile
- Safari (WebKit)
- Safari Mobile
Example
We will discuss the border-bottom-width property below, exploring examples of how to use this property in CSS.
Let's look at an example where we set the bottom border to a fixed width.
div { border-bottom-width: 2px; border-bottom-style: solid; }
In this CSS border-bottom-style example, we have set the width of the bottom border to 2px. Be sure to apply a border-bottom-style so that the border appears.
Next, let's try using one of the width keywords (thin, medium, thick) to set our bottom border width.
div { border-bottom-width: thick; border-bottom-style: solid; }
In this border-bottom-style example, we have set the bottom border to a thick line.
Advertisements