Skip to main content

Command Palette

Search for a command to run...

CSS Borders

Published
1 min read
CSS Borders

CSS Borders

The CSS border properties are used to specify the style, color, and size of the border of an element. The CSS border properties are given below

  • border-style
  • border-color
  • border-width
  • border-radius

1. border-style 👇

The CSS border properties allow you to specify the style, width, and color of an element's border.

Example👇 image.png

CSS Border Style 👇 image.png

We can also use multiple CSS Border styles in one tag👇 (Clock-Wise)

image.png

2. border-color 👇

The border-color property is used to set the color of the four borders.

Example 👇

image.png

Multiple border-color 👇 image.png

Example of using multiple border colors in CSS 👇 image.png

3. border-Width 👇

The border-width property specifies the width of the four borders.

image.png

Specific Side Widths 👇

image.png

Example of border-Width 👇 image.png

4. border-radius 👇

The border-radius property is used to add rounded borders to an element

image.png

For Multiple border-radius values 👇 image.png

CSS Shorthand Border Property 👇

To shorten the code, it is also possible to specify all the individual border properties in one property.

The border property is a shorthand property for the following individual border properties:

  • border-width
  • border-style (required)
  • border-color

image.png

Example 👇 image.png


image.png> Download our HTML & CSS Visual Treat! ebook Here: Click here