1 回答
TA贡献1851条经验 获得超3个赞
感谢遇到这个小提琴:https://jsfiddle.net/MadLittleMods/LmYay/
我设法解决了我的问题并有一个工作示例:https://jsfiddle.net/p459qvfk/2/
工作示例复制过来:
* {
font-family: Arial;
box-sizing: border-box;
}
html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
header {
display: flex;
flex-direction: column;
justify-content: flex-start;
/* align items in Main Axis */
align-items: stretch;
/* align items in Cross Axis */
align-content: stretch;
/* Extra space in Cross Axis */
min-height: 100vh;
background-color: #21D4FD;
background-image: linear-gradient(19deg, #21D4FD 0%, #B721FF 100%);
-webkit-box-shadow: 0px 10px 14px -6px rgba(0, 0, 0, 0.57);
box-shadow: 0px 10px 14px -6px rgba(0, 0, 0, 0.57);
border-radius: 0 0 80px 80px;
padding-left: 10%;
padding-right: 10%;
}
#p_test {
display: inline-block;
}
#feature_header_container {
display: flex;
flex: 1;
background-color: red;
align-items: center;
}
#feature_container {
display: inline-flex;
flex: 1;
justify-content: center;
background-color: blue;
color: white;
}
.feature_box {
background-color: pink;
}
<html>
<body>
<header>
<p id="p_test">
Test Test Test
</p>
<p id="p_test">
Test Test Test
</p>
<div id="feature_header_container">
<div id="feature_container">
<div class="feature_box">
<p>Test</p>
</div>
<div class="feature_box">
<p>Test</p>
</div>
<div class="feature_box">
<p>Test</p>
</div>
</div>
</div>
</header>
<main>
<p>TesttestTesttestTesttestTesttestTesttest</p>
</main>
</body>
</html>
- 1 回答
- 0 关注
- 74 浏览
添加回答
举报