Home>Article>Web Front-end> 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:
header 1
A paragraph.
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:
This is a header
This is a paragraph.
##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!