CKTIS / CSS
border-top-style — top border line style
The border-top-style property selects the pattern of the physical top border. It sets neither its color nor its thickness; its initial value is none.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
border-top-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset;border-top-style sets the style of the physical top edge, regardless of writing direction. It accepts one keyword, not a list of values for four sides. It is not inherited; its initial value is none, and animation is discrete rather than smoothly blending patterns.
solid means a continuous line, dotted dots, dashed dashes, and double two lines and a gap within the total specified thickness. groove and ridge create recessed and raised ridge effects; inset and outset suggest a sunken or raised box. Exact dot and dash spacing depends on the browser.
none and hidden draw no ordinary border. In the Level 4 model, they make the used border width zero without changing the computed width. In tables with border-collapse: collapse, their conflict resolution differs: hidden suppresses competing borders. A border image can replace the line pattern.
Set thickness with border-top-width and color with border-top-color. Later border, border-top, or border-style shorthands can override this style through the cascade. The example explicitly sets thickness and color and removes the other edges.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>border-top-style</title>
<style>
.sample {
width: 240px;
padding: 12px;
border: 0;
border-top-width: 6px;
border-top-color: #005a9c;
border-top-style: solid;
}
</style>
<div class="sample">border-top-style: solid</div>
</html>Result
border-top-style: solid
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.