获取图像拉伸div [英] Getting image to stretch a div
本文介绍了获取图像拉伸div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何获得图像来拉伸 DIV
类的高度?
How can I get an image to stretch the height of a DIV
class?
这:
但是,我希望DIV被拉伸,以使图像适当,但我不想调整图像的大小。
However, I would like the DIV to be stretched so the image fits properly, but I do not want to resize the image.
在这里是DIV的CSS(灰色框):
Here is the CSS for the DIV (the grey box):
.product1 {
width: 100%;
padding: 5px;
margin: 0px 0px 15px -5px;
background: #ADA19A;
color: #000000;
min-height: 100px;
}
应用于图片的CSS:
.product{
display: inline;
float: left;
}
那么,我该如何解决呢?
So, how can I fix this?
推荐答案
添加 overflow:auto;
到 .product1
这篇关于获取图像拉伸div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文