Border is an outline of any element created in HTML with the help of style sheet or css. You can set the color, style or thickness if required. All can be done in the css style sheet.
It has 3 attributes and you can either use one in each declaration or your can use all in one line of css code.
Border
Example for Border declaration:-
/*Syntax of Border declaration in CSS*/
bborder:10px solid #ff2354;
bborder:10px solid #ff2354;
What are 3 attributes of Border?
- Color
- Style
- Width
Border Color
If you want to set the color of the border, you can use border-color property. It has 4 values to use. You can use which you are comfortable with.
- Color Name
- Hexadecimal Number
- RGB Color code
- Transparent
Example for Border Color:-
/*Syntax of Border Color in CSS*/
bborder-color:#ff2354;
bborder-color:#ff2354;
Border Style
There are border styles in css and you can set the border style as per your requirement. It has 9 values to choose.- None
- Solid
- Dashed
- Dotted
- Double
- Inset
- Outset
- Groove
- Ridge
- hidden
Example for Border Style:-
/*Syntax of Border Style in CSS*/
bborder-style:5px solid;
bborder-style:5px solid;
Border Width
Border width is an important attribute in css if you are using this property with any of your element in the HTML page. You can set each side a different value.
It has 4 values:-
- Length (Pixel)
- Thin
- Thick
- Medium
Example for Border Width:-
/*Syntax of Border Width in CSS*/
bborder-width:value;
bborder-width:value;
As you know that there are 4 sides of border and you can set each side with different color, style and width.
4 sides of Border
- Border-Top
- Border-Bottom
- Border-Left
- Border-Right
Example for Border Style with different sides:-
/*Syntax of Border Style with different sides in CSS*/
/*TOP Border*/
border-top-color:#ff2354;:
border-top-width:2px;
border-top-style:dashed;
/*TOP Border*/
border-top-color:#ff2354;:
border-top-width:2px;
border-top-style:dashed;
/*Bottom Border*/
border-bottom-color:#ff2354;:
border-bottom-width:4px;
border-bottom-style:dotted;
/*Left Border*/
border-left-color:#ff2354;:
border-left-width:6px;
border-left-style:solid;
/*Right Border*/
border-right-color:#ff2354;:
border-right-width:7px;
border-right-style:groove;
NOTE:-
To use properties of border and its relevant values,
read posts on each topic in the next section of this blog.
0 comments:
Post a Comment