CSS - border-block-start-width Property



The logical block-start border width of an element is specified by the border-block-start-width CSS property, which is translated into a physical border width depending on the writing mode, directionality, and text orientation of the element.

Based on the writing-mode, direction, and text-orientation values entered, it can be used with border-top-width, border-right-width, border-bottom-width, or border-left-width.

Possible value

Syntax

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

Applies to

All the HTML elements.

CSS border-block-start-width - length Value

The following example demonstrates the usage of border-block-start-width property.

<html>
<head>
<style>
   body {
      font-family: 'Arial', sans-serif;
      margin: 50px;
      padding: 50px;
      background-color: #f0f0f0;
   }
   .new-container {
      background-color: #ffd700;
      width: 400px;
      height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 15px;
      box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
   }
   .custom-border {
      border: 4px dashed #e74c3c;
      border-block-start-style: ridge;
      border-block-start-width: 10px;
      padding: 15px;
      margin: 10px;
      font-size: 22px;
      font-weight: bold;
      color: #333;
   }
</style>
</head>
<body>
<div class="new-container">
<p class="custom-border">A border-block-start-width example</p>
</div>
</body>
</html>

CSS border-block-start-width - thin value

The following example demonstrates the usage of border-block-start-width property with thin width value.

<html>
<head>
<style>
   body {
      font-family: 'Arial', sans-serif;
      margin: 50px;
      padding: 50px;
      background-color: #f0f0f0;
   }
   .new-container {
      background-color: #a6d1ed;
      width: 400px;
      height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 15px;
      box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
   }
   .custom-border {
      border: 4px dashed #e74c3c;
      border-block-start-style: solid;
      border-block-start-width: thin;
      padding: 15px;
      margin: 10px;
      font-size: 22px;
      font-weight: bold;
      color: #333;
   }
</style>
</head>
<body>
<div class="new-container">
<p class="custom-border">A example with border-block-start-width property with thin style</p>
</div>
</body>
</html>

CSS border-block-start-width - medium value

The following example demonstrates the usage of border-block-start-width property with medium width value.

<html>
<head>
<style>
   body {
      font-family: 'Arial', sans-serif;
      margin: 50px;
      padding: 50px;
      background-color: #f0f0f0;
   }
   .new-container {
      background-color: #a6d1ed;
      width: 400px;
      height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 15px;
      box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
   }
   .custom-border {
      border: 4px dashed #034673;
      border-block-start-style: solid;
      border-block-start-width: medium;
      padding: 15px;
      margin: 10px;
      font-size: 22px;
      font-weight: bold;
      color: #333;
   }
</style>
</head>
<body>
<div class="new-container">
<p class="custom-border">A example with border-block-start-width property with medium style</p>
</div>
</body>
</html>

CSS border-block-start-width - thick value

The following example demonstrates the usage of border-block-start-width property with thick width value.

<html>
<head>
<style>
   body {
      font-family: 'Arial', sans-serif;
      margin: 50px;
      padding: 50px;
      background-color: #f0f0f0;
   }
   .new-container {
      background-color: #d8f0d3;
      width: 400px;
      height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 15px;
      box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
   }
   .custom-border {
      border: 4px dashed #1d8a07;
      border-block-start-style: solid;
      border-block-start-width: thick;
      padding: 15px;
      margin: 10px;
      font-size: 22px;
      font-weight: bold;
      color: #333;
   }
</style>
</head>
<body>
<div class="new-container">
<p class="custom-border">A example with border-block-start-width property with thick style.</p>
</div>
</body>
</html>

CSS border-block-start-width - Writing mode

The following example demonstrates the usage of border-block-start-width property with vertical writing mode.

<html>
<head>
<style>
   body {
      font-family: 'Arial', sans-serif;
      margin: 50px;
      padding: 50px;
      background-color: #f0f0f0;
   }
   .vertical-container {
      background-color: #87cefa;
      width: 400px;
      height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 15px;
      box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8);
   }
   .vertical-border {
      writing-mode: vertical-rl;
      border: 3px solid #475861;
      border-block-start-style: dotted;
      border-block-start-width: 6px;
      padding: 12px;
      margin: 10px;
      font-size: 20px;
      font-weight: bold;
      color: #333;
   }
</style>
</head>
<body>
<div class="vertical-container">
<p class="vertical-border">A border-block-start-width example with vertical writing mode.</p>
</div>
</body>
</html>
Advertisements