html Style Tag

In the html <style> tag is used to includes inner styles for html page and which provides style information for Html page and when you includes style tag you must assign type="text/css" attributes. Each html page you can use many <style> tag.html has introduced in new scoped attribute for <style> tag.

If you use scoped attribute for <style> tag, you can access inside of <body> that style sheet otherwise you must include <style> tag between <head> and </head>.Mostly type, media and scoped attribute we will use for style tag.

Syntax:

<style>
  ---
</style>

Example Code

<style>
  h1#one {
    color:#00CC00;
  }
  h2#two {
    color:#FF0000;
  }
</style>
<h1 id="one"> Heading 1 Style Sheet </h1>
<h2 id="two"> Heading 2 Style Sheet </h2>

Out Put:



Heading 1 Style Sheet

Heading 2 Style Sheet

In the above example css applied for h1 and h2 tag.In the h1 tag has applied green color and h2 tag has applied red color.





Content