我必须使用以下三列布局:
|div with stretched image|div adjusted to text|div with stretched image 2|
文本应居中,带有拉伸图像的div应该均等拉伸。
有些图像拉伸的div可能是空的。例如:
<div display="flex">
<div><img src=...></img>
</div>
<div>Text</div>
<div><img src=...></img>
</div>
</div>
<div display="flex">
<div></div>
<div>Text</div>
<div><img src=...></img>
</div>
</div>
<div display="flex">
<div><img src=...></img>
</div>
<div>Text</div>
<div></div>
</div>
最终结果应大致如下:
+----------------------------------------------------------+
| |Adjusted to text| |
| |Adjusted to | |
| |Adjusted| |
| |Adjusted to text| |
| |Adjusted to | |
| |Adjusted| |
+----------------------------------------------------------+
如何通过flexbox实现呢?