如何使用 CSS flexbox 设置固定宽度的列 - How to set a fixed width column with CSS flexbox

问题:

CodePen: http://codepen.io/anon/pen/RPNpaP .代码笔: http ://codepen.io/anon/pen/RPNpaP。

I want the red box to be only 25 em wide when it's in the side-by-side view - I'm trying to achieve this by setting the CSS inside this media query:我希望红色框在并排视图中只有 25 em 宽 - 我试图通过在此媒体查询中设置 CSS 来实现这一点:

@media all and (min-width: 811px) {...}

to:到:

.flexbox .red {
  width: 25em;
}

But when I do that, this happens:但是当我这样做时,会发生这种情况:

http://i.imgur.com/niFBrwt.png http://i.imgur.com/niFBrwt.png

Any idea what I'm doing wrong?知道我做错了什么吗?


解决方案:

参考一: https://en.stackoom.com/question/21OWi
参考二: https://stackoom.com/question/21OWi
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章