Home > Web Front-end > CSS Tutorial > How to change the color of hr tag in css

How to change the color of hr tag in css

王林
Release: 2020-11-17 16:32:06
Original
9109 people have browsed it

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.

How to change the color of hr tag in css

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;
}
Copy after login

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!

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