Back to Content

border-bottom-width

files/en-us/web/css/reference/properties/border-bottom-width/index.md

latest2.4 KB
Original Source

The border-bottom-width CSS property sets the width of the bottom border of an element.

{{InteractiveExample("CSS Demo: border-bottom-width")}}

css
border-bottom-width: thick;
css
border-bottom-width: 2em;
css
border-bottom-width: 4px;
css
border-bottom-width: 2ex;
css
border-bottom-width: 0;
html
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    This is a box with a border around it.
  </div>
</section>
css
#example-element {
  background-color: palegreen;
  color: black;
  border: 0 solid crimson;
  padding: 0.75em;
  width: 80%;
  height: 100px;
}

Syntax

css
/* Keyword values */
border-bottom-width: thin;
border-bottom-width: medium;
border-bottom-width: thick;

/* <length> values */
border-bottom-width: 10em;
border-bottom-width: 3vmax;
border-bottom-width: 6px;

/* Global keywords */
border-bottom-width: inherit;
border-bottom-width: initial;
border-bottom-width: revert;
border-bottom-width: revert-layer;
border-bottom-width: unset;

Values

  • <line-width>
    • : Defines the width of the border, either as an explicit nonnegative {{cssxref("<length>")}} or a keyword. If it's a keyword, it must be one of the following values:
      • thin
        • Same as 1px.
      • medium
        • Same as 3px.
      • thick
        • Same as 5px.

Formal definition

{{CSSInfo}}

Formal syntax

{{csssyntax}}

Examples

Comparing bottom border widths

HTML

html
<div>Element 1</div>
<div>Element 2</div>

CSS

css
div {
  border: 1px solid red;
  margin: 1em 0;
}

div:nth-child(1) {
  border-bottom-width: thick;
}
div:nth-child(2) {
  border-bottom-width: 2em;
}

Result

{{EmbedLiveSample('Comparing_bottom_border_widths', '100%')}}

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • The other border-width-related CSS properties: {{Cssxref("border-left-width")}}, {{Cssxref("border-right-width")}}, {{Cssxref("border-top-width")}}, and {{Cssxref("border-width")}}.
  • The other border-bottom-related CSS properties: {{Cssxref("border")}}, {{Cssxref("border-bottom")}}, {{Cssxref("border-bottom-style")}}, and {{Cssxref("border-bottom-color")}}.