gpt4 book ai didi

android - 为什么我的按钮的不可见元素在我的响应式设计中移位了?

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

我正在为以下网站设计响应式设计:

当我在移动 View 中单击图稿按钮时会出现问题。当我单击图稿按钮时,第二个菜单(由图像组成)出现在第一个菜单下方。如果使用 google chrome 开发人员工具检查第二个菜单,则会显示第二个菜单的一些不可见元素位于第一组按钮之上,从而导致冲突。我想知道如何使用我的 css 来纠正这个冲突。我相信罪魁祸首是 #nowrap li 元素,但我不知道如何在 CSS 中更正它。从我使用开发人员工具看到的情况来看,#nowrap li 元素已从其图像链接中移走。我曾尝试调整#nowrap li,但没有成功。我在下面包含了 HTML 和 CSS 代码:

#navbar {
margin-top: 100px;
background-color: black;
height: 280px;
text-align: center;
text-decoration: none;
list-style-type: none;
font-family: arial, helvetica, sans-serif;
}

#navbar li {
display: inline-block;
position: relative;
top: 0px;
}

#navbar li a {
padding: 1em;
text-decoration: none;
padding: 90px;
margin-top: 150px;
border: 4px solid #000;
background-color: white;
font-family: arial, helvetica, sans-serif;
}

#navbar li a:hover {
background-color: red;
color: #eee;
}

#logo {
position: relative;
top: 200px;
margin-top: -60px;
background-color: white;
height: 85px;
max-width: 100%;
right: 0px;
}

.graphic {
max-width: 100%;
height: auto;
}

#nowrap {
white-space: nowrap;
position: relative;
top: 100px;
}

#nowrap,
li {
list-style: none;
display: inline-block;
}

#A {
position: relative;
right: 0%;
}

#B {
position: relative;
right: 5%:
}

#C {
position: relative;
right: -10%;
}

#D {
position: relative;
right: -15%;
}

@media only screen and (max-width: 700px) {
#navbar li {
display: block;
vertical-align: middle;
}
#logo {
position: relative;
top: -900px;
right: 70px;
}
#whiteFile {
height: 70px;
top: 130px;
}
#nowrap li {
display: block;
margin-top: 10px;
}
#navbar li a {
display: block;
margin-top: 10px;
}
#A,
#B,
#C,
#D {
display: block;
vertical-align: middle;
margin-top: 20px;
position: relative;
top: 565px;
right: 0px;
}
#item {
top: 565px;
}
}
<ul id="nowrap">
<li><img id="A" src="GRAPHICSw.png" height="95" width="290"></li>
<li>
<a href="VIDEOS.html#item"><img id="B" src="VIDEOSb.png" height="95" width="290"></a>
</li>
<li>
<a href="PHOTOS.html#item"><img id="C" src="PHOTOSb.png" height="95" width="290"></a>
</li>
<li>
<a href="WEBSITES.html#item"><img id="D" src="WEBSITESb.png" height="95" width="290"></a>
</li>
</ul>
<div id="whiteFile"></div>

最佳答案

这是一个简单的修复。我的 CSS 正在处理我的菜单中的各个图像,将它们与 ul 分开。我需要将图像位置归零并调整 ul 而不是图像。

关于android - 为什么我的按钮的不可见元素在我的响应式设计中移位了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51125640/

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