Home > Web Front-end > CSS Tutorial > How to use style tag?

How to use style tag?

coldplay.xixi
Release: 2020-06-30 13:53:08
Original
17505 people have browsed it

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.

How to use style tag?

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).

How to use style tag?

2. The style tag can be placed in several locations. Generally, the most common one is placed in the head tag

How to use style tag?

3. Then put it as an attribute in the start tag of the element, and use; to separate each attribute value.

How to use style tag?

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.

How to use style tag?

5. Then there is the font size that is commonly used. The attribute used is font-size

How to use style tag?

6. Then add a background color to the element. The attribute used is background-color

How to use style tag?

7. Finally, the font is displayed in the center, using the attribute It's text-align

How to use style tag?

## 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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template