What are the methods to add CSS to HTML documents?Inline Style Sheets: They are placed inline with the element using style attribute that can contain any css property.
Embedded Style Sheets: They are added in <head> element by using the <style> element. Example
<head> <style type="text/css"> h1 { color: black; font-weight: bold} </style> </head>
External Style Sheets: They are a separate .css files that contain the CSS rules. These files are linked with HTML documents using <link> tag.
Imported Style Sheets: They import style rules from other style sheets. To import CSS rules, use @import before all the rules in a style sheet.
|