Home > Web Front-end > Front-end Q&A > How to add color to span in html

How to add color to span in html

藏色散人
Release: 2023-01-03 09:31:26
Original
6882 people have browsed it

htmlHow to add color to span: 1. Add code such as "span{color:blue;}" or other selectors to the corresponding css file; 2. Add code such as "span" to the head tag {color:blue;}"; 3. Add css style to the corresponding tag.

How to add color to span in html

The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer

Set the color in span

<span></span>
Copy after login

There are three ways:

1. External 2. Embedded 3. Inline

1. How to use: in HTML file Add

to the head tag, and then add code to the corresponding css file, such as: span{color :blue;} or other selector.

2. How to use: Add to the head tag in the HTML file and add code, such as: span{color:blue;} or other selectors.

3. How to use: …………Add css style in the corresponding tag, such as: .

These three methods have priorities, usually: 3>2>1; But when one of the three methods is added to the code: "!important", then its priority Highest. But it's better not to use it. The purpose of priority is: whoever has a higher priority will be loaded by the browser first!

Recommended study: "HTML Video Tutorial"

The above is the detailed content of How to add color to span in html. 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