DEV Community

Divya Divya
Divya Divya

Posted on

CSS TYPES?

  • Inline CSS

  • Internal CSS

  • External CSS

Inline CSS:
Inline CSS is applying styling directly to individual HTML elements using the style attribute.

Example:

<p style="color: red; text-align: center;">This is a paragraph</p>
Enter fullscreen mode Exit fullscreen mode

Internal CSS:
It's particularly useful for applying unique style to a single web page and it's embedded within the style
element located in the head section of the HTML file.

Example:

<html>
<head>
<title>title goes here</title>

<style>
h1{
color:red;
text-align:center;
}
</style>
</head>

<body>
<h1>Paragraph</h1>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

External CSS:
External CSS is stored in a seperate css file and linked to the html document using the link tag in headsection.

Example:

<link rel="stylesheet" href="style.css">
Enter fullscreen mode Exit fullscreen mode

Top comments (0)