我正在尝试更改菜单中的文本颜色,我尝试了颜色标签和文本装饰颜色标签,但它们都不起作用。这是我正在做的 CSS 工作
#meny {
position: absolute;
top: 201px;
left: 290px;
width: 800px;
height: 50px;
text-align: center;
position: fixed;
top: 201px;
width: 60%;
display: flex;
font-weight: bold;
font-size: smaller;
color: #cccccc !important;
}
#meny a {
line-height: 50px;
flex: 1 0 auto;
font-family: verdana;
text-decoration: none
}
<!doctype html>
<html>
<head>
<title>Markveien legesenter</title>
<meta charset="utf-8">
<link href="medic.ico" rel="icon" type="image/x-icon" />
<link href="stil.css" rel="stylesheet">
</head>
<body>
<div id="header">
<img src="del2.jpg">
</div>
<div id="bilde">
<img src="del1.jpg">
</div>
<div id="meny"> <a href="#">HJEM</a><a href="#">OM OSS</a><a href="#">SLIK BESTILLER DU</a><a href="#">INFORMASJON</a><a href="#">LENKER</a>
</div>
</body>
</html>
最佳答案
您应该覆盖 a 的颜色,但您将颜色放在容器上:
#meny a {
line-height: 50px;
flex: 1 0 auto;
font-family: verdana;
text-decoration: none;
color: #ccc; /*add color here*/
}
关于html - 更改 html 中的文本颜色不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40495163/