border-block-start-width
        
        
          
                Baseline
                
                  Widely available
                
                
              
        
        
        
          
                
              
                
              
                
              
        
        
      
      This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
border-block-start-width は CSS のプロパティで、要素の論理的なブロックの先頭側の境界の幅を定義し、それが要素の書字方向やテキストの方向に応じて物理的な境界の幅に対応づけられます。これは border-top-width, border-right-width, border-bottom-width, border-left-width の何れかに対応し、どれに対応するかは writing-mode, direction, text-orientation で定義された値によって決まります。
試してみましょう
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">
    これは周囲に境界線があるボックスです。
  </div>
</section>
#example-element {
  background-color: palegreen;
  color: #000;
  border: 0 solid crimson;
  padding: 0.75em;
  width: 80%;
  height: 100px;
  unicode-bidi: bidi-override;
}
構文
css
/* <'border-width'> 値 */
border-block-start-width: 5px;
border-block-start-width: thick;
/* グローバル値 */
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;
関連するプロパティとしては、 border-block-end-width, border-inline-start-width, border-inline-end-width が要素の他の境界の幅を定義します。
値
- <'border-width'>
- 
境界の幅です。 border-widthを参照してください。
公式定義
| 初期値 | medium | 
|---|---|
| 適用対象 | すべての要素 | 
| 継承 | なし | 
| パーセント値 | 包含ブロックの論理的な幅 | 
| 計算値 | 絶対的な長さ、境界スタイルが noneまたはhiddenであれば0 | 
| アニメーションの種類 | 計算値の型による | 
形式文法
border-block-start-width =
<line-width>
<line-width> =
<length [0,∞]> |
thin |
medium |
thick
例
>縦書きテキストの境界の太さ
HTML
html
<div>
  <p class="exampleText">テキストの例</p>
</div>
CSS
css
div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}
.exampleText {
  writing-mode: vertical-lr;
  border: 1px solid blue;
  border-block-start-width: 5px;
}
結果
仕様書
| Specification | 
|---|
| CSS Logical Properties and Values Level 1> # border-width> | 
ブラウザーの互換性
Loading…
関連情報
- CSS 論理的プロパティと値
- このプロパティは border-top-width,border-right-width,border-bottom-width,border-left-widthのうちの1つに対応づけられます
- writing-mode,- direction,- text-orientation