Associate styles with your HTML document using methods inline CSS and External CSS.
You can use style attribute of any HTML element to define inline style rules. These rules will be applied to that element only. Here is the generic syntax:
<element style = "...style rules....">
The follow
ing is the attribute:
Attribute | Value | Description |
---|---|---|
style | style rules | The value of style attribute is a combination of style declarations separated by a semicolon (;). |
Let us see an example:
<html> <head> </head> <body> <h2 style = "color:#800000;"> This is inline CSS </h2> </body> </html>