gpt4 book ai didi

html - 为什么我不能为我的 body 添加背景?

转载 作者:行者123 更新时间:2023-11-28 07:20:17 24 4
gpt4 key购买 nike

我有一个简单的 html 脚本,它只包含一个导航栏,但是由于某些原因,我无法在 css 中为我的主体添加颜色。我不断地一遍又一遍地尝试。任何人都可以看到我哪里出错了。

HTML

<html>

<head>
<title>OUZO</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="animate.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<meta charset="UTF-8">
<link rel="shortcut icon" href="images/logo-4.ico">
</head>

<body>

<nav align="middle">

<ul>
<li><a href="#"><img src="images/video-menu.png" class="vid" style="height:35px; width:70px; margin-bottom:20px; border-left:8px solid black; border-right:8px solid black;" onmouseover="this.src='images/video-menu-hover.png'"onmouseout="this.src='images/video-menu.png';"></a></li>
<li><a href="#"><img src="images/news-menu.png" class="news" style="height:35px; width:70px; margin-bottom:20px; border-left:8px solid black; border-right:8px solid black;" onmouseover="this.src='images/news-menu-hover.png'"onmouseout="this.src='images/news-menu.png';"></a></li>
<li><a href="#"><img src="images/logo.png" class="home" style="height:80px; width:80px;" onmouseover="this.src='images/logo-hover.png'"onmouseout="this.src='images/logo.png';"></a></li>
<li><a href="#"><img src="images/games-menu.png" class="games" style="height:35px; width:70px; margin-bottom:20px; border-right:8px solid black;border-left:8px solid black;" onmouseover="this.src='images/games-menu-hover.png'"onmouseout="this.src='images/games-menu.png';"></a></li>
<li><a href="#"><img src="images/music-menu.png" class="music" style="height:35px; width:70px; margin-bottom:20px; border-right:8px solid black; border-left:8px solid black;" onmouseover="this.src='images/music-menu-hover.png'"onmouseout="this.src='images/music-menu.png';"></a></li>
</ul>



</nav>



</body>

</html>

CSS

    li {

display: inline;
margin-right: .75em;
padding: 2px;

}

body {
height: 100%;
overflow: hidden;
background-color: #d8d8d8;
}



@font-face {
font-family: Font;
src: url('fonts/font.woff') format('woff'),
url('fonts/font.woff');
}

a {
font-size: 15px;
color: black;
text-decoration: inherit;
}


ul {
position: fixed;
left: 0;
right: 0;;
margin: 0;
padding: 0;
border-bottom: 8px solid black;
border-width: 100%;
background-color: #d8d8d8;

}

最佳答案

您正在使用 JQuery Mobile,因此您必须覆盖 JQM 样式。另外,您需要将 style.css 放在 JQM 样式链接下方。

.ui-page { background:#000; }

关于html - 为什么我不能为我的 body 添加背景?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32122817/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com