Home >Web Front-end >CSS Tutorial >How to use style tag?
The usage of the style tag is: 1. Put the style tag in the head tag; 2. Put it as an attribute in the start tag of the element, and use [;] to separate each attribute value; 3. Use attributes color, add the font color of the style attribute.
The usage of style tag is:
1. The function of style attribute:
provided A universal way to change the style of all HTML elements.
Styles were introduced in HTML 4 and are the new preferred way to change the style of HTML elements. HTML styles allow you to add styles directly to HTML elements using the style attribute, or indirectly by defining them in a separate style sheet (CSS file).
2. The style tag can be placed in several locations. Generally, the most common one is placed in the head tag
3. Then put it as an attribute in the start tag of the element, and use; to separate each attribute value.
4. So what styles can be added to this style attribute? The most commonly used one is font color, and the attribute used is color.
5. Then there is the font size that is commonly used. The attribute used is font-size
6. Then add a background color to the element. The attribute used is background-color
7. Finally, the font is displayed in the center, using the attribute It's text-align
## Recommended tutorial: "css tutorial"
The above is the detailed content of How to use style tag?. For more information, please follow other related articles on the PHP Chinese website!