Sunday, 26 June 2016

How to CSS Adding In HTML

There are three way to use CSS:-

  1. Inline
  2. Internal
  3. External
Inline:-
<!DOCTYPE html>
<html>
<head>

</head>
<body>

<h1 style="color:blue;">This is a Blue Heading</h1>

</body>
</html>


Internal:-

<!DOCTYPE html>
<html>
<head>
<style>
body {background-color:lightgrey;}
h1   {color:blue;}
p    {color:green;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

External:-

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

No comments:

Post a Comment