What Is CSS
What Is CSS :
1. Css
stands for cascading style sheets.
2. Styles
define how to display HTML elements.
3. Styles
are normally stored in style sheets.
4. External
style sheets are stored in css files.
5. Multiple
style definitions will cascade into one.
The css syntax
is madeup of 3 parts :
Selector,
property and a value.
Selector
{
Property : value ;
}
Type selector is
the html element, the property is attribute and each attribute can take a
value.
Body
{
Color: #FF0000
}
P
{
Text-align:
center;
Color : black;
Font-family :
arial;
}
You can group
selectors by separating each selector with a comma.
H1,h2,h3,h4,h5,h6
{
Color: green;
}
The class
selector :
<style =
“text/css”>
.class
{
}
</style>
Ex:
.right
{
Text-align:
right;
}
.center
{
Text-align :
center;
}
< p
class=”right”>this property will be right aligned.
<p
class=”center”> this paragraph will be center-aligned.
0 comments:
Post a Comment