There are three types of CSS
- External style sheet
- Internal style sheet
- Inline style
External CSS
Example -
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="demo.css">
</head>
<body>
<h1>Demo1</h1>
<p>paragraph.</p>
</body>
</html>
Internal CSS
Example -
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Inline CSS
Example -
<!DOCTYPE html>
<html>
<body>
<h1 style="color:blue;margin-left:30px;">This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
0 comments:
Post a Comment