CSS Syntax:
A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts:- Selector: A selector is an HTML tag at which style will be applied. This could be any tag like <h1> or <table> etc.
- Property: A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color or border etc.
- Value: Values are assigned to properties. For example color property can have value either red or #F1F1F1 etc.
<html>
<head>
<style>
h1
{
color:#FFC000;
text-align:center;
}
p{
color:#CCF;
text-align:center;
font-family:'arial';
font-size:'20px';
}
</style>
</head>
<body>
<h1>this is heading styled with CSS</h1>
<p>This paragraph is styled with CSS.</p>
</body>
</html>


0 comments:
Post a Comment