如何将我的div放在每个人(垂直)旁边的情况下,而不会重叠?

发布于 2025-01-23 09:05:00 字数 1279 浏览 2 评论 0原文

我的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅浅 2025-01-30 09:05:00

您可以使用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;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文