--- title: border-top-width slug: Web/CSS/border-top-width tags: - CSS - Propriété - Reference translation_of: Web/CSS/border-top-width ---
La propriété border-top-width définit l'épaisseur de la bordure pour le côté haut d'une boîte.
/* Une valeur de longueur */ /* Type <length> */ border-top-width: 10em; border-top-width: 3vmax; border-top-width: 6px; /* Valeurs avec un mot-clé */ border-top-width: thin; border-top-width: medium; border-top-width: thick; /* Valeurs globales */ border-top-width: inherit; border-top-width: initial; border-top-width: unset;
<line-width>thin (fin)medium (intermédiaire)thick (épais)thin ≤ medium ≤ thick et que ces valeurs soient constantes pour un même document..element1{
border-top: thick solid red;
}
.element2{
border-top: medium solid orange;
}
.element3{
border-top: thin solid green;
}
<p class="element1"> Une bordure épaisse rouge. </p> <p class="element2"> Une bordure moyenne orange. </p> <p class="element3"> Et une bordure fine verte. </p>
{{EmbedLiveSample("Exemples","200","300")}}
| Spécification | État | Commentaires |
|---|---|---|
| {{SpecName('CSS3 Backgrounds', '#the-border-width', 'border-top-width')}} | {{Spec2('CSS3 Backgrounds')}} | Pas de modification significative. |
| {{SpecName('CSS2.1', 'box.html#border-width-properties', 'border-top-width')}} | {{Spec2('CSS2.1')}} | Définition initiale. |
{{cssinfo}}
{{Compat("css.properties.border-top-width")}}