![](/img/trans.png)
[英]How to fix the width and height of div and make the content inside div resize to div's width and height?
[英]How to fix the height and width of image inside div generated dynamically
<div id="ARDiv" style="bottom: 10px; float: left; position: fixed; height:200px ; width:161px;">
</div>
在此Div图片中使用jquery依次显示图像
我想要做的是固定图像的高度和宽度,以使其不会比
height:200px ; width:161px;
编辑:这就是我的宣传者的工作方式-
$("#ARDiv").adrotator({ intervalTime: 3000, xmlFileName: 'Adrotator.xml' });
你可以像这样用css做
#ARDiv img {
height:200px ;
width:161px;
}
或在插入图片后使用jquery添加此.height(200).width(161);
您可以在CSS中固定大小:
#ARDiv img{
height: 200px;
width: 161px;
}
^这表示#ARDiv
div中出现的任何图像都将固定为这些尺寸
或在jQuery中: $('#ARDiv').find('img').height('200px').width('161px');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.