HTML style Tag

Example

Use of the <style> element in an HTML document:
<html>
<head>
<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
</head>

<body>
<h1>A heading</h1>
<p>A paragraph.</p>
</body>
</html>

Teach Yourself  by BH24 HTML Editor Tool!

The <style> tag is supported in all major browsers.

Definition and Usage

The <style> tag is used to define style information for an HTML document.
Inside the <style> element you specify how HTML elements should render in a browser.
Each HTML document can contain multiple <style> tags.

Tips and Notes

Tip: To link to an external style sheet, use the <link> tag.
Tip: To learn more about style sheets, please read our CSS Tutorial.
Note: If the "scoped" attribute is not used, each <style> tag must be located in the head section.