html - 更改 html 中的文本颜色不起作用

标签 html css colors

我正在尝试更改菜单中的文本颜色,我尝试了颜色标签和文本装饰颜色标签,但它们都不起作用。这是我正在做的 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/

相关文章:

html - 从右到左的标点符号不正确,阿拉伯文字换行

jquery - 使用 jQuery 的图像像素颜色选择器

vim - 如何在 Vim CtrlP 中自定义线条高亮颜色?

html - Flexbox 在盒子中居中

javascript - jQuery 在 IE7 中不生成 DIV

javascript - 如何将从数据库中提取的数字传递到 javascript 数据部分?

css - 在 Bootstrap 中更改任何事物的背景颜色的最佳方法是什么

html - 打开后我的 bootstrap Toggle 消失了

JavaScript : Execute code only if it is not google chrome browser

Java:使用数组中的十六进制值延迟更改背景颜色