【发布时间】:2018-11-26 20:20:35
【问题描述】:
我正在使用 flex 来对齐 div 内的文本和两个按钮。这是我的代码
#wrapper {
background-color: gray;
display: flex;
padding-left: 90px;
padding-right: 90px;
}
#left {
padding-top: 33px;
padding-bottom: 33px;
flex: 0 0 65%;
height: 80px;
line-height: 44px;
}
#right {
padding-top: 45px;
padding-bottom: 45px;
flex: 1;
}
#button1 {
height: 70px;
width: 70px;
margin-right: 20px;
}
#button2 {
height: 70px;
width: 70px;
}
<div id="wrapper">
<div id="left">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard.
</div>
<div id="right">
<input type="button" value="More" id="button1">
<input type="button" value="Ok" id="button2">
</div>
</div>
此代码在大多数浏览器上都能正常运行,但在其他一些浏览器中不支持 flex。有没有其他方法可以达到相同的效果并创建横幅?
【问题讨论】:
-
使用内嵌块元素