Home  >  Article  >  Web Front-end  >  How to use html style tag

How to use html style tag

青灯夜游
青灯夜游Original
2019-05-26 18:09:076797browse

The style tag of

html is used to define CSS style information for HTML documents. In style, you 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.

How to use html style tag

#html How to use the style tag?

Function: Used to define style information for HTML documents.

Description: 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.

Note: To link to an external style sheet, please use the tag.

html style tag example

<html>
    <head>
        <style type="text/css">
        h1 {color: red}
        p {color: blue}
        </style>
    </head>
<body>
    <h1>PHP中文网</h1>
    <p>免费的PHP教育公益培训平台</p>
</body>
</html>

Output:

How to use html style tag

The above is the detailed content of How to use html style tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use html p tagNext article:How to use html p tag