embedded style code"; 2. Used to specify the inline style of the element. This attribute will override any Global style setting, the syntax is " Home >Web Front-end >Front-end Q&A >What is the usage of style in html5 Usage: 1. Used to specify the embedded style of html documents, the syntax is ""; 2. Used to specify Element inline style, this attribute will override any global style settings, the syntax is " The operating environment of this tutorial: Windows 10 system, HTML5 version, Dell G3 computer. 1. Used to define style information for HTML documents In style, you can specify how the HTML document is rendered in the browser. The type attribute is required and defines the content of the style element. The only possible value is "text/css". The style element is located in the head section. The attribute type value is text/css and specifies the MIME type of the style sheet. The example is as follows: Output result: 2. Used to specify the inline style of elements The style attribute specifies the inline style of the element. The style attribute will override any global style settings, such as those specified in the Syntax style_definition One or more CSS properties and values separated by semicolons. The example is as follows: ##Recommended tutorial: "html video tutorial The above is the detailed content of What is the usage of style in html5. For more information, please follow other related articles on the PHP Chinese website!What is the usage of style in html5
What is the usage of style in html5
<html>
<head>
<style type="text/css">
h1 {color: red}
p {color: blue}
</style>
</head>
<body>
<h1>header 1</h1>
<p>A paragraph.</p>
</body>
</html>
<element style="value">
<html>
<body>
<h1 style="color:blue">This is a header</h1>
<p style="color:red">This is a paragraph.</p>
</body>
</html>
Output result: