如何将我的div放在每个人(垂直)旁边的情况下,而不会重叠?
我的div是重叠的,这是我的index.html的代码:
.titlesec {
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
margin-bottom: 50px;
padding: 20px;
}
#moi {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 107px 70px 0 70px;
height: 80vh;
}
.nom h1 {
font-family: 'Lato', sans-serif;
font-size: 130px;
}
.intro {
margin-top: 150px;
width: 50%;
align-self: flex-end;
line-height: 35px;
font-size: 23px;
}
<div id="moi">
<div class="nom reveal-">
<h1>Maxime Miquel</h1>
</div>
<div class="intro reveal-2" >
<p >some text no one cares about</p>
</div>
</div>
<div id="one" class="titlesec reveal-2">
<h1>TITLE</h1>
</div>
<div id="formation">
.........
</div>
结果:浏览器中的
图像我减少了视线。当我将#MOI的高度更改为80VH时,出现了这个问题。
希望有人可以帮助我。谢谢=)
My divs are overlapping here's the code of my index.html :
.titlesec {
display: flex;
justify-content: center;
align-items: center;
font-size: 20px;
margin-bottom: 50px;
padding: 20px;
}
#moi {
display: flex;
flex-direction: column;
align-items: flex-start;
margin: 107px 70px 0 70px;
height: 80vh;
}
.nom h1 {
font-family: 'Lato', sans-serif;
font-size: 130px;
}
.intro {
margin-top: 150px;
width: 50%;
align-self: flex-end;
line-height: 35px;
font-size: 23px;
}
<div id="moi">
<div class="nom reveal-">
<h1>Maxime Miquel</h1>
</div>
<div class="intro reveal-2" >
<p >some text no one cares about</p>
</div>
</div>
<div id="one" class="titlesec reveal-2">
<h1>TITLE</h1>
</div>
<div id="formation">
.........
</div>
And the result : Image in a browser
The title is overlapping the div right on top of it when i reduce the viewheight. This problem appeared when i changed the height of #moi to 80vh.
Hope someone can help me. Thank you =)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用Flex框容器,也可以使用CSS网格制作两列。
网格区域:项目1,item2
item1,item2;
You can either use the flex box containers or you can use the css grid to make two columns.
grid-area: item1, item2
item1, item2;