CSS (Internal, Inline and External) CSS

EXTERNAL CSS Example

<html>
<head>
<link rel=”stylesheet” href=”styles.css”>

</head>
<body>
<h1> i am a heading</h1>
<p> i am a para</p>

</body>
</html>

 

Styles.css

body {
background-color: blue;
}
h1 {
color: white;
}
p {
color: red;
}

 

Internal CSS example

<html>
<head>
<style>

body {
background-color:blue;
}
h1 {
color:white;
}
p {
color:red;
}

</style>

</head>
<body>
<h1> i am a heading</h1>
<p> i am a para</p>

</body>
</html>

Inline CSS example

<html>
<body>

<h1 style=”color:blue;”>A Blue Heading</h1>

<p style=”color:red;”>A red paragraph.</p>

</body>
</html>

 

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *