There are three way to use CSS:-
- Inline
- Internal
- External
Inline:-
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1 style="color:blue;">This is a Blue Heading</h1>
</body>
</html>
<html>
<head>
</head>
<body>
<h1 style="color:blue;">This is a Blue Heading</h1>
</body>
</html>
Internal:-
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color:lightgrey;}
h1 {color:blue;}
p {color:green;}</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
<html>
<head>
<style>
body {background-color:lightgrey;}
h1 {color:blue;}
p {color:green;}</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
External:-
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
No comments:
Post a Comment