Home >Web Front-end >CSS Tutorial >Set hyperlink font color through html/css

Set hyperlink font color through html/css

巴扎黑
巴扎黑Original
2017-06-03 14:40:203717browse

The hyperlink font color setting is set through css. There are two commonly used color settings for a link, 1. The initial state color of hyperlink a, 2. The mouse-over color of the hyperlink font, and the other two This disease is not commonly used: 3. The visited color of the hyperlink font

The hyperlink font color setting is set through css. There are two commonly used color settings for a link: 1. The initial color of the hyperlink a Status color, 2. The mouse-over color of the hyperlink font, and two other diseases that are not commonly used: 3. The visited color of the hyperlink font, 4. The color of the hyperlink font when the mouse is pressed

The corresponding css attributes of the four hyperlink states are: a{}, a:hover{}, a:visited{}, a:active{}. Usually just write a{}, a:hover{}, if you need For the other two font color settings, please refer to the following order to write

a{color:red;}
a:visited{color:green;}
a:hover {color:yellow;background:blue;}
a:active {color:lime;background:red;}

Here, Lazy Website Builder releases a tip for setting other font colors: the font and background color when the text is selected (the default is white text on a blue background), This default effect can be changed through the settings below.

::-moz-selection { background:#d3d3d3; color:#555;}
::-webkit-selection { background:#d3d3d3; color:#555;}
::selection { background:#d3d3d3; color:#555;}/*文本选中以后的颜色*/

The above is the detailed content of Set hyperlink font color through html/css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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