Types of CSS (Cascading Style Sheet)

Three are three types of CSS (Cascading Style Sheet): CSS is used to define styles for your web pages.

1. Inline Stylesheet
2. Internal Stylesheet
3. External Stylesheet
————————————-
1. Inline style sheet : Inline style sheets are used in inline in paragraph

<!DOCTYPE html>
<html lang=“en”>
<head>
<meta charset=“utf-8”>
</head>
<body>

<p style=” font-family:Arial, Helvetica, sans-serif; font-size:18px; text-align:center; color:#d20404; “>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl. Donec laoreet condimentum lorem nec facilisis.

</p>

</body>
</html>

2. Internal style sheet : Internal style sheet are used in <style> element.

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”utf-8″>
<style type=”text/css”>
body{
background-color:#ddd;
font-family: “Arial, Helvetica, sans-serif”;
font-size:18px;
}
</style>

</head>
<body>

<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl. Donec laoreet condimentum lorem nec facilisis. </p>

</body>
</html>

3. External Style Sheet : External stylesheets are stored in CSS files.

<!DOCTYPE html>
<html lang=“en”>
<head>
<link type=“text/css” href=“css/style.css” rel=“stylesheet”>
</head>
<body>

<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sagittis, justo eu maximus tempor, ante ex scelerisque sem, vel auctor velit justo et nisl. Donec laoreet condimentum lorem nec facilisis. </p>

</body>
</html>


Leave a Reply

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