What is a border?
- CSS border properties allow you to set the border around the HTML elements.
- We can use different properties for the border. Like border color, width, style, etc.
- Also, we can make a border corner rounded with the help of border-radius.
Border Properties
border-color: border-color is used to set the color of the border.
border-radius: The border-radius property is used to set the radius of the border corners.
border-style: The border-style property defines what type of border will be displayed. Now let's see some border-style values:
This index.html file will be our boilerplate code and we will add all border properties on .para.
index.html
Border Style Values
i) dotted - Used to set a dotted border.
This is a dotted border paragraph
ii) dashed - It defines a dashed border.
This is a dashed border paragraph
iii) solid - Defines a solid border.
This is a solid border paragraph
iv) double - Defines a double border.
This is a double border paragraph
v) groove - Groove defines a 3D grooved border. The effect depends on the border-color value.
This is a groove border paragraph
vi) ridge - It defines a 3D ridged border. The effect depends on the border-color value.
This is a ridge border paragraph
vii) inset - Defines a 3D inset border. The effect depends on the border-color value.
This is an inset border paragraph
viii) outset - It defines a 3D outset border. The effect depends on the border-color value.
This is an outset border paragraph
ix) none - Defines no border.
This is a no-border paragraph
x) hidden - Defines a hidden border.
CSS Border Example:
Output:
This is a paragraph
Output: