我有以下HTML使用flex container
来容纳两个div,一个包含图像(在左侧),另一个包含一些文本:
<!DOCTYPE html>
<html>
<body>
<div id="wrapper" style="display:flex; background:pink;">
<div id="image_div">
<img src="http://i.imgur.com/MvnfA1U.png">
</div>
<div id="number_list">
<h3>One</h3>
<h3>Two</h3>
<h3>Three</h3>
<h3>Four</h3>
<h3>Five</h3>
<h3>Six</h3>
<h3>Seven</h3>
</div>
</div>
</body>
</html>
结果如下:
如何让图像增加尺寸并占据其(粉红色)容器的整个高度,同时:
由于
答案 0 :(得分:-2)
<!DOCTYPE html>
<div id="wrapper" style="display:flex; background:pink;justify-content:space-between;">
<div id="image_div">
<img src="http://i.imgur.com/MvnfA1U.png" style="height:100%;">
</div>
<div id="number_list" style="width:50%">
<h3>One</h3>
<h3>Two</h3>
<h3>Three</h3>
<h3>Four</h3>
<h3>Five</h3>
<h3>Six</h3>
<h3>Seven</h3>
</div>
</div>