How to change the color of the hr tag in css: You can use the background-color attribute and combine it with the border and height attributes. The border attribute is to prevent the black box from appearing, and the height attribute is to prevent it from not being displayed under Firefox.
First of all, we need to know that if we want to modify the color of the hr tag, we cannot do it simply by using the background-color attribute.
(Learning video sharing: java video tutorial)
The method is as follows:
hr{ border: none; height: 1px; background-color: #e5e5e5; }
Analysis:
border: none; or border: 0; is to prevent a black box from appearing
height: 1px; is to prevent it from not being displayed under firefox
background-color: #e5e5e5; is to fill in the color you need to change
Related recommendations: CSS tutorial
The above is the detailed content of How to change the color of hr tag in css. For more information, please follow other related articles on the PHP Chinese website!