我有一个设置为.content-container
的div
display: flex
和我想并排显示的子div(.message-body, .message-action
),其中.message-action
div浮动在右侧。
以下是我的工作:
https://codepen.io/anon/pen/ZRZKdZ
如您所见,.message-action
div似乎低于.message-body
div。
最佳答案
如果需要并排使用,则需要在容器上使用flex-direction:row
而不是column
(有关此属性的详细信息,请阅读https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction)。
(同时移除float:right
)
更新笔:https://codepen.io/anon/pen/qKwjNa
关于html - Flex-box显示 child div并排显示,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51163099/