Use the Style Tag to Define Style Information for an HTML Page



The HTML <style> tag is for declaring style sheets within the head of the HTML document and the technique is known as Internal CSS to add CSS to HTML Page. CSS can be used in various ways in HTML. One of them is by using Internal CSS i.e. using a <style> tag.

The <style> tag is used in the <head>…</head> tag. It defines CSS style for a single page.

Example

You can try to run the following code to use the <style> tag

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <style>
         h1 {color: green;}
         p {font-size: 14px;}
      </style>
   </head>
   <body>
      <h1>Tutorials</h1>
      <p>We provide free learning content.</p>
   </body>
</html>
Updated on: 2020-01-10T10:57:10+05:30

6 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements