The border-style property specifies what kind of border to display. You can set the color, style and width of the borders around an element in one declaration by using the border property.
border-style values:
border: 1px solid #000000;
Values:
- color
- style
- width
Border Color
The border-color property is used to set the color of the border. The color can be set by:
- color name
- hexadecimal number
- RGB color code
- transparent
Borders can have the following styles.
<p style="border:2px solid blue;">This text has a border style of 'solid'.</p> <p style="border:2px dotted blue;">This text has a border style of 'dotted'.</p> <p style="border:2px dashed blue;">This text has a border style of 'dashed'.</p> <p style="border:2px double blue;">This text has a border style of 'double'.</p> <p style="border:2px groove blue;">This text has a border style of 'groove'.</p> <p style="border:2px ridge blue;">This text has a border style of 'ridge'.</p> <p style="border:2px inset blue;">This text has a border style of 'inset'.</p> <p style="border:2px outset blue;">This text has a border style of 'outset'.</p> <p style="border:2px hidden blue;">This text has a border style of 'hidden'.</p>
This results in:
This text has a border style of 'solid'.
This text has a border style of 'dotted'.
This text has a border style of 'dashed'.
This text has a border style of 'double'.
This text has a border style of 'groove'.
This text has a border style of 'ridge'.
This text has a border style of 'inset'.
This text has a border style of 'outset'.
Border Width
You can set the width of a border independently with the border-width property.
border-width: value;
Values:
- Length
- Thin
- Medium
- Thick
No comments:
Post a Comment