Types of CSS



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>

Share on Google Plus

About It E Research

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment