Notes-Types of CSS
Notes-Types of CSS
Types of CSS
→Internal CSS
→Inline CSS
→External CSS
Internal Style Sheet
• An internal style sheet may be used if one single HTML page has a
unique style.
• Internal CSS is defined within the <style> element in the HTML
document's <head> section.
<!DOCTYPE html>
<html>
<head>
<style>
p{
background: linen;
font-family:Calibri;
}
H1 {
color: maroon;
text-align:center;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Inline CSS
• used to apply a unique style for a single HTML element.
• It uses the style attribute.
• Inline CSS is applied directly within the HTML tags using the style
attribute.
External CSS
• External CSS is defined in a separate CSS file and then linked to the
HTML document using the <link> element.
Attributes:
• Rel: type of file
• Href: Path of the file/file name
<link rel=”stylesheet” href=mystyle.css>