Html 5 Style Tag

In the html 5 <style> tag is used to includes inner styles for html page. Each html page you can use many <style> tag.html5 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