部分在HTML中重叠 [英] Sections are Overlapping In HTML
本文介绍了部分在HTML中重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道如何使各节停止在HTML / CSS中重叠。我尝试使用边距和填充,但是它们不起作用。
I can't figure out how to get my sections to stop overlapping in HTML/CSS. I've tried using margin and padding but they're not working.
HTML和CSS:
#projects {
display: block;
height: 100vh;
width: 100vw;
margin: 20px 20px 20px 20px;
padding: 20px 20px 20px 20px;
#education {
display: block;
height: 100vh;
width: 100vw;
margin: 20px 20px 20px 20px;
padding: 20px 20px 20px 20px;
}
<body>
<section id="projects">
<!--there's a lot of irrelevant code in the middle here-->
</section>
<section id="education">
<!--there's a lot of irrelevant code in the middle here-->
</section>
</body>
缩小页面时的结果:
Result when I shrink the page:
推荐答案
可能是您在项目中的内容
部分比固定的 height:100vh
长,并且您没有处理重叠的内容。
probably your content in the projects
section is longer than the fixed height: 100vh
and you're not handling the overlapping content.
尝试将您的高度
更改为最小高度
或使用CSS属性来处理内容溢出/溢出- y
try changing you height
to min-height
or handling content with css property overflow/overflow-y
这篇关于部分在HTML中重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文