HOW TO ADD <STYLE> to html code example

Example 1: add stylesheet html

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

Example 2: how to add a css file in html

<!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>

Example 3: how to add style to p tag in html

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

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

</style>
</head>
<body>

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

</body>
</html>

Example 4: html add style

<!-- add this line into the head tag -->
<link rel="stylesheet" type="text/css" href="yourstylesheetname.css">
<!-- remember to change the irl in href -->

Example 5: how to style in html file

<p style="text-align: center; color: pink;">Hello World</p>

Example 6: where do you put style tags in html

// Style tags belong in <head>

Tags: