我的网站上有一个下拉菜单,上面有5个项目。在第五项之后,它将以定义的背景色继续扩展,并转到页面底部。当我在下拉菜单中添加高度时,它可以解决此问题,但是显然,我不能添加高度。我只希望它扩展到列表中的最后一项。我不知道为什么会这样。
尝试添加定义的高度。这行得通,并且滚动条出现在侧面。但是,除非高度是所列物品的100%,否则这不是可行的解决方案。
此CSS代码中的菜单为“ onepress-menu-mobile”:
/* my own editing starts */
div.contact {
margin-bottom:3vh;
}
div.contact p {
text-align:center;
font-weight:bold;
font-size:4.5vh;
}
div.contact p.number,
div.contact p.number2,
div.contact p.email {
margin-bottom:0px;
line-height:1.4em;
}
div.contact p.number2 {
font-size:2vh;
}
#about, #services, #gallery {
padding-top:7vh;
padding-bottom:2vh
}
#gallery {
background:white;
}
div.section-desc {
text-align: left;
}
div.section-desc li {
margin: 0px 3vh 0px 8vh;
color: black;
}
div.section-desc img {
border-radius:3px;
margin:20px auto;
display:block;
border:2px solid black;
padding:1px;
width:100%;
}
div.section-desc div.video {
margin:20px auto;
}
div.section-desc .lastparagraph {
font-size:3vh;
margin:0px 5vh;
}
#main.site-main p {
margin-left:3vh;
margin-right:3vh;
}
.myself {
float:left;
margin:5px 22px 30px 10px;
width:30vw;
border:2px solid black;
border-radius:5px;
}
div.site-branding {
margin-left:-25px;
}
p {
font-size:18px;
color:black;
}
#primary.content-area {
padding-top:20px;
padding-bottom:10px;
}
a.site-text-logo:hover {
color:#116ebf !important;
}
ul.onepress-menu a:hover {
text-shadow: 0px 0px 8px white;
text-decoration:underline;
transition: 0s;
color:white;
}
ul.onepress-menu {
color:white;
}
ul.onepress-menu.onepress-menu-mobile {
background:black;
height:100%;
}
.site-header {
background: black;
}
#nav-toggle span,
#nav-toggle span:before,
#nav-toggle span:after {
background:white;
}
#nav-toggle.nav-is-visible span,
#nav-toggle.nav-is-visible span:before,
#nav-toggle.nav-is-visible span:after {
background:white !important;
}
.aboutme {
margin-left:39% !important;
}
.arve-wrapper {
border: 3px solid black;
}
#features div.feature-media {
margin:0px;
padding:0px;
}
#features h4 {
margin-bottom:30px;
}
#features {
padding:20px 0px 5px 0px;
}
.hero-large-text {
font-size:7.2vw !important;
}
div.hero__content p {
font-size: 6.8vw;
margin:0px !important;
line-height: 7vh;
}
#hero div.container {
padding-top:22% !important;
padding-bottom:3% !important;
}
div.container {
width:100%;
padding-left:25px;
padding-right:25px;
}
答案 0 :(得分:0)
没关系,想通了。您不必回答这个问题,很好。