gpt4 book ai didi

html - 联系链接上升到其他链接之上

转载 作者:行者123 更新时间:2023-11-28 06:07:34 25 4
gpt4 key购买 nike

Here is what is looks like!

到目前为止,我的编码非常简单。我在最右边的联系链接似乎上升了,它在我的其他链接上方形成了一个额外的区域,作为链接区域。我检查了我的 css,一切看起来都不错,但我很新,所以它可能非常简单。这是代码:

HTML:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Derek Edwards Portfolio</title>
<link href="Web Porfolio.css" rel="stylesheet" type="text/css" />
</head>

<body class="mainbody">

<nav>
<p>
<ul class="navbar">
<li class="listitem"><a href="#"/>Contact</li>
<li class="listitem"><a href="#"/>Portfolio</li>
<li class="listitem"><a href="#"/>About</li>
<li class="listitem"><a href="#"/>Home</li>
</ul>
</p>

</nav>
</body>
</html>

我的 css 也很简单:

   @charset "utf-8";

.mainbody {
margin:0px;
padding:0px;
background-image:url(../../Desktop/Portfolio/Background.jpg);
background-size:100%;
background-attachment:fixed;
}

.navbar {
position: fixed;
top: 0;
width: 100%;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
opacity: 0.4;
}

.listitem {
float: right;
border-left: 1px solid #bbb;
list-style-type: none;
}

.listitem a {
font-family: Verdana, Geneva, sans-serif;
font-size: 1em;
display: block;
color: white;
text-align: center;
padding: 10px 5px;
text-decoration: none;
}

.listitem a:hover {
background-color: #111;
}

最佳答案

在“.listitem a”中应该是

显示:内联 block ;

这将解决它。您的代码中有一些有问题的决定,但这会解决您的问题。

关于html - 联系链接上升到其他链接之上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36368390/

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