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.
The operating environment of this article: windows7 system, HTML5&&CSS3 version, DELL G3 computer
Set the color in span
<span></span>
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!