CSS CSS Tutorial CSS Advanced CSS Responsive Web Design(RWD) CSS Grid CSS Properties Sass Tutorial Sass Functions



border-block-style

CSS (Cascading Style Sheets) is a style sheet language used for describing the presentation of a document written in HTML (Hypertext Markup Language). CSS provides a wide range of properties to style the HTML elements. One of the properties is the border-block-style property, which is used to set the style of the border on the block-level elements.

Brief Explanation of Border-Block-Style

The border-block-style property is used to set the style of the border on the block-level elements. The block-level elements are the elements that take up the full width of the parent element and start on a new line. The border-block-style property is a shorthand property that sets the style of the top, right, bottom, and left borders of an element.

The border-block-style property can take the following values:

  • none: No border is displayed.
  • hidden: The border is hidden.
  • dotted: The border is a series of dots.
  • dashed: The border is a series of dashes.
  • solid: The border is a solid line.
  • double: The border is a double line.
  • groove: The border looks like a 3D groove.
  • ridge: The border looks like a 3D ridge.
  • inset: The border looks like it is carved into the page.
  • outset: The border looks like it is coming out of the page.

Code Examples

Let's take a look at some code examples to understand how the border-block-style property works:

Example 1: Setting the Border-Block-Style to Solid

In this example, we will set the border-block-style property to solid:

  
    <div style="border-block-style: solid;">
      This is a div element with a solid border.
    </div>
  
This is a div element with a solid border.

Example 2: Setting the Border-Block-Style to Dotted

In this example, we will set the border-block-style property to dotted:

  
    <div style="border-block-style: dotted;">
      This is a div element with a dotted border.
    </div>
  
This is a div element with a dotted border.

Example 3: Setting the Border-Block-Style to Double

In this example, we will set the border-block-style property to double:

  
    <div style="border-block-style: double;">
      This is a div element with a double border.
    </div>
  
This is a div element with a double border.

Example 4: Setting the Border-Block-Style to Groove

In this example, we will set the border-block-style property to groove:

  
    <div style="border-block-style: groove;">
      This is a div element with a groove border.
    </div>
  
This is a div element with a groove border.

Example 5: Setting the Border-Block-Style to Inset

In this example, we will set the border-block-style property to inset:

  
    <div style="border-block-style: inset;">
      This is a div element with an inset border.
    </div>
  
This is a div element with an inset border.

Example 6: Setting the Border-Block-Style to Outset

In this example, we will set the border-block-style property to outset:

  
    <div style="border-block-style: outset;">
      This is a div element with an outset border.
    </div>
  
This is a div element with an outset border.

Conclusion

The border-block-style property is a useful property in CSS that allows you to set the style of the border on the block-level elements. With the help of this property, you can make your web pages more visually appealing and attractive. By using the examples provided in this article, you can easily understand how the border-block-style property works and how you can use it in your own web pages.

References

Activity