CSS Syntax
A CSS style sheet consists of a set of instructions that is interpreted by the web browser and after interpreted by the web browser instructions are applied to the corresponding elements. Such as - paragraph, heading, div, etc.
The CSS Syntax Rule is made of three major parts:-
- Selectors: - A Selector is an html tag on which the CSS Style Sheet will be applied. Like :- <h1>, <p>, <span> etc.
- Property: - A property is a type of attribute of the Html elements. Such as Color, border, etc.
- Value: - Value is assigned on the CSS Property. Such as Color is the property and red is the value which is assigned to the color attribute.
Syntax of CSS
<html>
<head>
<title> Example of CSS Syntax </title>
<style>
h1{
color: Red;
background-color: Yellow;
}
p{
color: Yellow;
background-color: green;
}
</style>
</head>
<body>
<h1> This is a Heading. </h1>
<p> This is a Paragraph. </p>
</body>
</html>
Output: -
0 comments:
Post a Comment