CSSย Borders

CSSย Borders

ยท

1 min read

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

ย