Using Css How HTML Elements Should Display

admin_img Posted By Bajarangi soft , Posted On 27-09-2020

css is a cascade style sheet ,it describes how html elements should display ,in css to add a document to the html have a 3 ways Inline,Internal,External ,with css we can control color,background images,text color and all to display html page with adding Css

Css describes HTML Page

1.INLINE CSS IN HTML

<!DOCTYPE html>
<html>
<body>

<h1 style="color:blue;">Hello goodmorning</h1>

<p style="color:red;">have a nice day!.</p>

</body>
</html>

2.INTERNAL CSS IN HTML

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

<h1>hello Goodmorning</h1>
<p>Have a nice day!.</p>

</body>
</html>

 

3.EXTERNAL CSS IN HTML
external.css

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

<h1>Hello goodmorning</h1>
<p>Have a nice day!</p>

</body>
</html>

 

4.Create External  Css File Need to Create
style.css

body {
  background-color: powderblue;
}
h1 {
  color: blue;
}
p {
  color: red;
}

 

4.Add this link to the HTML File

  <link rel="stylesheet" href="styles.css">

Related Post