CSS:

Types:

Inline CSS:

W can apply CSS in a single element by inline CSS technique.The inline CSS is also a method to insert style sheets in HTML document. This method mitigates some advantages of style sheets so it is advised to use this method sparingly.

Syntax:

< htmltag style="cssproperty1:value; cssproperty2:value;" > < /htmltag >

Internal CSS:

W can apply CSS internally.The internal style sheet is used to add a unique style for a single document. It is defined in < head > section of the HTML page inside the < style > tag.

Example:

< head > < style > body { background-color: linen; } h1 { color: red; margin-left: 80px; } < /style > < /head >

External CSS:

W can apply CSS externaly. The external style sheet is generally used when you want to make changes on multiple pages. It is ideal for this condition because it facilitates you to change the look of the entire web site by changing just one file. It uses the < link > tag on every pages and the < link > tag should be put inside the head section.

Example:

< head >< link rel="stylesheet" type="text/css" href="mystyle.css" >< /head >