style element
| A A | Font size |
|
|
Share |
|
Specifies style sheet rules for a document.
The style element allows authors to include CSS code into the HTML document.
The style tag should be placed in the head element.
To insert an external CSS file into the HTML document, use link element.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
| If you want to use this element dynamically, visit the JavaScript page for this tag: style. |
Possible members:
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Example HTML code 1:
This example illustrates the use of the style element:
|
|
||||
<head> <style> #sampleID {color:red;} .sampleClass {color: green;} b {color: blue;} </style> </head> <body> <div id="sampleID">The color of this text is red.</div> <div class="sampleClass">The color of this text is green.</div> <b>The color of this text is blue.</b> </body> |
||||
|
||||
|
Did you find this example helpful?
|
External links:
User Contributed Comments

