unaml unaml - 1 month ago 14
CSS Question

Changing text color in html doesen't work

I'm trying to change the text color in a menu, I have tried the color tag and the text-decoration-color tag, but neither of them work. Here is what I am working on, in 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>




Answer

You should override the color of a, but you are putting the color on the container:

#meny a {
  line-height: 50px;
  flex: 1 0 auto;
  font-family: verdana;
  text-decoration: none;
  color: #ccc; /*add color here*/
}