gpt4 book ai didi

html - 链接无法在导航栏中显示

转载 作者:太空宇宙 更新时间:2023-11-04 11:37:06 25 4
gpt4 key购买 nike

出于某种原因,我的导航栏中的链接根本不显示在浏览器中,但我的 Logo 会显示!

我希望 Logo 位于屏幕左侧,链接位于屏幕右侧导航栏中的水平位置。

这是我的 HTML 代码:

@font-face {
font-family: "Lato-Regular";
src: url("../fonts/Lato-Regular/Lato-Regular.ttf");
src: url("../fonts/Lato-Regular/Lato-Regular.woff");
}
@font-face {
font-family: "PT-Sans";
src: url("../fonts/PT-Sans/PTS55F.ttf");
src: url("../fonts/PT-Sans/PTS55F.woff");
}
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 1500px;
font-size: 0px;
overflow-x: none;
}
body {
font-size: 62.5%;
}
.wrapper {
height: 1500px;
}
#navigation_bar {
width: 100%;
height: 100px;
background-color: #1d1d1d;
}
main {
height: 1300px;
}
#container_wrapper {
width: 100%;
height: 865px;
background-color: green;
}
#footer {
width: 100%;
height: 435px;
background-color: blue;
}
#copyright {
width: 100%;
height: 100px;
background-color: black;
}
img {
max-width: 100px;
max-height: 100px;
}
a:link {
font-family: "Lato-Regular", "PT-Sans", "Calibri Light", sans-serif;
font-size: 1.2em;
line-height: 3.7em !important;
text-transform: uppercase;
color: #ffffff;
}
a:hover {
color: green;
}
li {
float: right;
list-style-type: none;
list-style: none;
background: clear;
padding: 0;
margin: 0;
}
a {
display: block;
width: 60px;
background-color: blue;
margin: 0;
padding: 0;
text-decoration: none;
position: relative;
text-align: center;
float: none;
}
<!DOCTYPE html>
<html lang="en-us">

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My Website</title>
<link href="css/stylesheet.css" type="text/css" rel="stylesheet" />
</head>

<body>
<div class="wrapper">
<nav id="navigation_bar">
<a href="images/logo.gif" class="logo" id="home">
<img src="#" alt="Logo" title="Logo" />
</a>
<ul class="navbar_list">
<li class="nav_list" id="about"><a href="#">Home</a>
</li>
<li class="nav_list" id="films"><a href="#">About</a>
</li>
<li class="nav_list" id="other"><a href="#">Other</a>
</li>
</ul>
</nav>
<!--End of NAV-->
<main id="container">
<div id="container_wrapper">
</div>
<div id="footer">
</div>
</main>
<!--End of Main-->
<footer id="copyright">
</footer>
</div>
<!--End of WRAPPER-->
</body>

</html>

问题:如何在位于屏幕右侧且 Logo 位于左侧的导航栏中显示没有元素符号的水平无序列表?

最佳答案

删除 body {font-size:0px;},这会使您的所有文本不可见。

float: left; 在 Logo 上(这样它不会将您的导航向下推)

具有上述更改的解决方案:JSFIDDLE

关于html - 链接无法在导航栏中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31658154/

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