flex-框不是包装框
我已经制作了.main_area
flexbox,其中有两个元素,但Flex-wrap无法正常工作。 我希望,如果我在820px屏幕上打开它,那么它应该是对此的解决方案
.main_area {
display: flex;
flex-wrap: wrap;
/* background-color: burlywood; */
height: 80vh;
width: 100%;
}
.picture_area {
display: flex;
align-items:baseline;
justify-content: flex-end;
/* background-color: red; */
height: 80vh;
width: 50%;
}
.picture_area img {
height: 100%;
/* width: 100%; */
float: right;
filter: grayscale(1);
}
.content_area {
/* background-color: blue; */
height: 80vh;
width: 30%;
flex-direction: column;
align-items: center;
justify-content:center;
}```
the html code is
``` <div class="main_area">
<div class="picture_area" id="picture_area">
<img src="./Cartoons_Bugs_Tunes_Looney_Bunny_Bugs_bunny_HD_Wallpapers-removebg.png" alt="">
</div>
<div class="content_area d-flex" id="content_area">
<h1 class="UI_pattern">UI Problem</h1>
<h1 class="UI_pattern">solver</h1>
<p class="UI_para">And this is why my competitors</p>
<p class="UI_para">Simply call me 'Revolver'</p>
<input type="text" class="Busi_email" placeholder="Type your business email">
<button class="UI_button">Get in touch</button>
</div>
</div>
I have made the .main_area
a flexbox and it has two elements in it but flex-wrap is not working.
I want that if i open it on 820px screen then it shouldautomaticaly wrap is there a solution to this
.main_area {
display: flex;
flex-wrap: wrap;
/* background-color: burlywood; */
height: 80vh;
width: 100%;
}
.picture_area {
display: flex;
align-items:baseline;
justify-content: flex-end;
/* background-color: red; */
height: 80vh;
width: 50%;
}
.picture_area img {
height: 100%;
/* width: 100%; */
float: right;
filter: grayscale(1);
}
.content_area {
/* background-color: blue; */
height: 80vh;
width: 30%;
flex-direction: column;
align-items: center;
justify-content:center;
}```
the html code is
``` <div class="main_area">
<div class="picture_area" id="picture_area">
<img src="./Cartoons_Bugs_Tunes_Looney_Bunny_Bugs_bunny_HD_Wallpapers-removebg.png" alt="">
</div>
<div class="content_area d-flex" id="content_area">
<h1 class="UI_pattern">UI Problem</h1>
<h1 class="UI_pattern">solver</h1>
<p class="UI_para">And this is why my competitors</p>
<p class="UI_para">Simply call me 'Revolver'</p>
<input type="text" class="Busi_email" placeholder="Type your business email">
<button class="UI_button">Get in touch</button>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能忘记在 CSS 语句之前添加选择器吗?
Might have you forgotten to add the selector before your CSS statement?
这应该对您有效:
This should work nicely for you: