"Reprint please retain the integrity of the content of the Wind network article, if you do not comply with this principle, we will retain the right to pursue legal responsibility"
<style> Label
Definitions and usage
The <style> tags define the style information for the HTML document.
In the style element, you specify how HTML elements are rendered in the browser.
Instance
To use the style element in an HTML document:
<html>
<head>
<style type= "Text/css" >
h1 {color:red}
p {Color:blue}
</style>
</head>
<body>
<h1>Header-1</h1>
<p>this is a paragraph.</p>
</body>
</html>
Try it for yourself.
<! DOCTYPE html>
<html>
<head>
<style type= "Text/css" >
h1 {color:red}
p {Color:blue}
</style>
</head>
<body>
<h1>Header-1</h1>
<p>this is a paragraph.</p>
</body>
</html>
Differences between HTML 4.01 and HTML 5
The scoped property is a new attribute in HTML 5 that allows us to define a style for the specified part of the document, not the entire document.
If you use the scoped property, the specified style can only be applied to the parent element of the style element and its child elements.
Wind Network (www.ithov.com) tips and comments:
Wind Network tip: If you want to link external style sheet, please use <link> label.
Wind Network tip: If you need to learn more about style sheet knowledge, please visit the relevant CSS tutorial.
Note: If the scoped property is not defined, the <style> element must be in the <head> section.
Property
The
property Value Description Type TEXT/CSS defines the content type. Media screen
TTY
TV
Projection Handheld
Print
Braille
Aural
the target media for all style information. Scoped scoped If you use this property, the style applies only to the parent element of the style element and its child elements.
Standard properties
<style> tags support standard properties in HTML 5.
Event Properties
<style> tags support event properties in HTML 5.