【发布时间】:2015-05-29 23:56:19
【问题描述】:
I have this simple div with a button inside of it。 justify-content: center; 在 Firefox 和 Chrome 上运行良好,但在 IE 11 上无法运行:
#div {
height: 200px;
width: 50px;
border: 1px solid black;
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
}
#button {
height: 50px;
width: 200px;
min-width: 200px;
border: 1px solid black;
background-color: red;
}
<div id="div">
<button id="button">HELLO</button>
</div>
我的目标是,当我将transform 与rotate(90deg) 或rotate(270deg) 一起使用时,the button will fit into the div:
#div {
height: 200px;
width: 50px;
border: 1px solid black;
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
}
#button {
height: 50px;
width: 200px;
min-width: 200px;
border: 1px solid black;
background-color: red;
transform: rotate(90deg);
}
<div id="div">
<button id="button">HELLO</button>
</div>
div 和 button 中的 height 和 width 始终相同,但可以自定义。
我尽量不包装元素。
【问题讨论】:
标签: css flexbox internet-explorer-11