Day 12: CSS: Box Model, Border, Padding And Margin
Box Model:
------------------------------------------------------------------------------------------------
Border:p{
border-style: groove;
border-width: think;
border-color: red;
}
h{
border-style: solid;
}
1. CSS border Property
- border-width, border-style, and border-color are collectively referred to as the border property.
- It is a shorthand property for border width, style and color.
- Shorthand properties are CSS properties that allow you to simultaneously change the values of several other CSS properties.
- You can write style sheets that are quicker to write and frequently easier to understand by using a shorthand feature.
- Available border-styles : (Try all of them)
- Solid
- Dotted
- Dashed
- Double
- none
Syntax :
border: border-width border-style border-color;
Code :
-----------------------------------------------------------------------------------------------
padding and margin
1. The text-decoration Property :
- The shorthand CSS property of text-decoration controls how decorative lines appear on text.
- Values :
- none: No line is not drawn and if there already exists any decoration, it is removed.
- underline: A line of thickness 1px is drawn at the baseline.
- line-through: the "middle" point of the text is marked with a 1 px line.
- overline: a 1px line is drawn across the text, just above the "top" position.
- Syntax
text-decoration: value;
Example :
Code :
Output :
Comments
Post a Comment