CSS can be implemented in three ways in an HTML document(webpage):
- Inline CSS
- Internal Style Sheet
- External Style Sheet
Inline CSS
To style a specific HTML element, Inline CSS is used. To implement this use style attribute.
Example
<p style="background-color:yellow;">Hello World</p>
Internal Style Sheet
To Style HTML elements of a single webpage. It is implemented with inside head section.
Example
<head>
<style>
body {
background-color: green;
}
</style>
</head>
External Style Sheet
To style multiple webpages of a website with a single CSS file. External stylesheet reference must be added using tag in the head section.
Example
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>