CKTIS / CSS
border-bottom — bottom border
The border-bottom shorthand sets the width, style, and color of the bottom border. Omitted components return to their initial values, so leaving out the style can make the line invisible.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate; verification passed for the `usage` example
Syntax
border-bottom: <line-width> || <line-style> || <color>;border-bottom is shorthand for border-bottom-width, border-bottom-style, and border-bottom-color. It targets the physical bottom edge regardless of writing direction. It is not inherited and does not set the other edges.
In <line-width> || <line-style> || <color>, || means one or more components may appear in any order. Width accepts a nonnegative length or thin, medium, or thick; percentages are not allowed. An example style is solid, and an example color is #0066cc.
Omitted components receive their initial values: medium, none, and currentColor. Therefore, border-bottom: red resets the style to none rather than preserving an earlier style. With style none, the computed width is zero. currentColor uses the element's color value. To change only the color without resetting the rest, use border-bottom-color.
The example explicitly sets all three components. The expected result is a white box containing text, with a solid blue bottom line 4 CSS pixels thick.
Examples
<!doctype html>
<meta charset="utf-8">
<title>border-bottom</title>
<style>
.sample {
width: 200px;
padding: 8px;
color: #000;
background: #fff;
border-bottom: 4px solid #0066cc;
}
</style>
<div class="sample">border-bottom</div>Result
A white box containing “border-bottom”, with a solid blue bottom border 4 CSS pixels thick.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.