Cette page a été traduite à partir de l'anglais par la communauté. Vous pouvez contribuer en rejoignant la communauté francophone sur MDN Web Docs.

View in English Always switch to English

border-block-start-width

Baseline Widely available

Cette fonctionnalité est bien établie et fonctionne sur de nombreux appareils et versions de navigateurs. Elle est disponible sur tous les navigateurs depuis janvier 2020.

>

La propriété CSS border-block-start-width définit la largeur de la bordure logique de début de bloc d'un élément, qui correspond à une bordure physique selon le mode d'écriture, la direction et l'orientation du texte de l'élément. Elle peut correspondre à border-top-width, border-right-width, border-bottom-width ou border-left-width selon les valeurs définies pour writing-mode, direction et text-orientation.

Exemple interactif

border-block-start-width: thick;
writing-mode: horizontal-tb;
border-block-start-width: thick;
writing-mode: vertical-rl;
border-block-start-width: 4px;
writing-mode: horizontal-tb;
border-block-start-width: 4px;
writing-mode: vertical-lr;
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    Ceci est une boîte avec une bordure autour.
  </div>
</section>
#example-element {
  background-color: palegreen;
  color: black;
  border: 0 solid crimson;
  padding: 0.75em;
  width: 80%;
  height: 100px;
  unicode-bidi: bidi-override;
}

Syntaxe

css
/* Valeurs de type <'border-width'> */
border-block-start-width: 5px;
border-block-start-width: thick;

/* Valeurs globales */
border-block-start-width: inherit;
border-block-start-width: initial;
border-block-start-width: revert;
border-block-start-width: revert-layer;
border-block-start-width: unset;

Les propriétés associées sont border-block-end-width, border-inline-start-width et border-inline-end-width, qui définissent les autres largeurs de bordure de l'élément.

Valeurs

<'border-width'>

La largeur de la bordure. Voir border-width.

Définition formelle

Valeur initialemedium
Applicabilitétous les éléments
Héritéenon
Pourcentageslargeur logique du bloc englobant
Valeur calculéeune longueur absolue ; 0 si le style de la bordure vaut none ou hidden
Type d'animationpar type de valeur calculée

Syntaxe formelle

border-block-start-width = 
<line-width>

<line-width> =
<length [0,∞]> |
thin |
medium |
thick

Exemples

>

Bordure avec du texte vertical

HTML

html
<div>
  <p class="exempleTexte">Texte d'exemple</p>
</div>

CSS

css
div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exempleTexte {
  writing-mode: vertical-lr;
  border: 1px solid blue;
  border-block-start-width: 5px;
}

Résultat

Spécifications

Specification
CSS Logical Properties and Values Module Level 1>
# border-width>

Compatibilité des navigateurs

Voir aussi