html - CSS中的背景颜色问题

标签 html css background-color

我在编写这段代码时遇到了问题。

 <body>
    <header>
      <div class="menu">
        <div class="sayfa_ismi"><h1>PAGE TİTLE</h1></div>
            <nav class="menues">
                <ul>
                    <li><a href="index.html" class="home"><p>Home Page</p></a></li>
                    <li><a href="galery.html" class="galery"><p>Galery</p></a></li>
                    <li><a href="stry.html" class="stry"><p>Story</p></a></li>
                    <li><a href="herkes_nerede.html"class="where"><p>Where are the people</p></a></li>
                    <li><a href="iletisim.html" class="iletisim"><p>Contact</p></a></li>
                </ul>
            </nav>
      </div>
    </header>



    </div>
  </body>

在 CSS 中

header{
  position: fixed;
  width: 100%;
  height: 20%;
}

/*************************** title position ************************************/
.sayfa_ismi{
  text-align: center;
}
/*************************** menue position************************************/
nav li{
  display: inline-block;
      margin: 0 8% 0 0;
  }

nav{
  margin: 0 0 0 15%;
}

/*************************** menu links************************************/
.menues a:link{
  color:rgb(255,255,255);
  text-decoration: none;
}
.menues a:hover{
  color:blue;
  background-color:white;
}

.menues a:visited{
  color: blue;
  background-color:#FFFFFF;
  text-decoration: none;

}
/***** header font type and background color *****************************/
header{
  background-color: rgb(59, 113, 255);
  font-family: 'Andada', serif;
  font-size: 110%;
}

我希望标题的背景颜色为 rgb(59, 113, 255),并且我希望当我们链接时背景颜色为白色,但没有。 我该如何解决这个问题?

最佳答案

您应该删除 a 标记内的 p 标记。

这是更新的 fiddle :fiddle link

希望这有帮助!

关于html - CSS中的背景颜色问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43436509/

相关文章:

PHP:通过链接传递变量

html - 在 Prestashop 上加载页面期间白色闪烁

html - "clear: both"的最佳途径

javascript - 图片上传前预览时通过id获取图片

javascript - 水平滚动的多个粘性部分

html - 使用 requestFileSystem 和 toUrl() 函数显示图像

html - chrome/firefox 中的文字颜色不同

html - 如何为div的背景颜色设置不透明度?

flutter - 如何在Flutter中将图像和其他 View 用作背景

c# - GridView 中的背景颜色