Different Type Of CSS Code in HTML

Put Your Plan Into Action

Different Type Of CSS Code in HTML

Three Type Of Style Sheet Code

  • In Line CSS
  • External CSS
  • Internal CSS

In-Line and Internal CSS

<html>
<head>
<link rel="stylesheet"type="text/css"href="mystyle.css">
<style>
p
{
background-color:blue;
}

h3
{
color:maroon;
margin-left:40px;
}

</style>
</head>
<body>

<h1>Welcome to CSS(external)</h1>
<h2 style="color:yellow;margin-left:30px;">This is a heading (inline)</h2>
<h3>this is h3 heading</h3>
<p> This is a program to demonstrate external,internal and inline style sheets(internal)</p>
</body>
</html>

In line css which is written in html tag and Internal css is which is written in HEAD Tag in style code as given above.

External CSS code

h1{color:blue;font-weight:bold;}

This css code written in Another file and that file link to our html file

<link rel="stylesheet"type="text/css"href="mystyle.css">

 

Leave a Reply

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