【发布时间】:2017-02-02 07:14:10
【问题描述】:
快速提问。我正在尝试使用 flex...
<div class="cont">
<div class="1">
<img src="sm1.png" alt="1" title="1" /> short_texttexttext
</div>
<div class="2">
<img src="sm2.png" alt="2" title="2" /> short_texttexttext
</div>
</div>
只是居中,居中,但 flex 将图像和文本“合并”为一个项目:
IMG 文字
IMG 文字
我想要:
IMG 文字 | IMG 文字(居中)
唯一的选择是添加额外的 div?没门!有什么想法吗?
【问题讨论】:
-
你目前使用的 CSS 在哪里?
-
@Hunter Turner 你确实认为不错。这是 css 错误(错误的类名)。但是 [at]Sebastian Brosch 提供了一个很好的解决方案,所以也许有人会利用这个错误。