How to define style information of a document using HTML5 ?
In this Article, we define style information for a document by using the <style>
element in the document. It is used to change our text, viewed on the page. This change includes changing font-size, font-family, font-color, etc. Not only the texts but you can also change the style of a body or part of a page. Now let us look into various attributes of style and what else the tag supports.
Syntax:
<tagname style="property:value;">
Example 1: The following example demonstrates to define style information for a document using HTML5.
<!DOCTYPE html> < html > < head > < title > How to define style information for a document using HTML5? </ title > </ head > < body > < h1 style = "font-family:commanders;" > Hello w3wiki. </ h1 > < h2 style = "font-family:Chaparral Pro Light;" > Hello w3wiki. </ h2 > < h3 style = "font-family:algerian;" > Hello w3wiki. </ h3 > < p style = "font-family:Castellar;" > Hello w3wiki. </ p > </ body > </ html > |
Output:
Example 2:
<!DOCTYPE html> < html > < head > < title > How to define style information for a document using HTML5? </ title > </ head > < body style = "background-color:#616A6B;" > < h1 style="font-family:commanders; background-color:yellow;"> Hello w3wiki. </ h1 > < h2 style="font-family:algerian; background-color:cyan;"> Hello w3wiki. </ h2 > < p style="font-family:Castellar; background-color:green;"> Hello w3wiki. </ p > </ body > </ html > |
Output:
Supported Browsers are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
- Safari