本文介绍了DIV宽度和高度在设置innerHTML时不会调整大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我将图像设置为DIV容器的innerHTML时,DIV的宽度和高度仍未更改。 div有 border:solid 样式,边框就像图片的外部一样... ...
图像显示完整,但它伸展在div边界之外,但仍然显示。这是一个问题吗?
我应该使用DOM方法吗?
谢谢
解决方案您是否设置了div的溢出 css属性?
www.w3schools/Css/pr_pos_overflow.asp
When I set an image to the innerHTML of a DIV container, the width and height of the DIV is still not changed. The div has border:solid style and the border is like "outside" the image...
So the image is shown fully, but it streches outside the div borders, but still shows anyway. Is this a problem ?
Should I use the DOM method instead, will it be better ?
Thanks
解决方案have you set the overflow css property of your div ?
www.w3schools/Css/pr_pos_overflow.asp
更多推荐
DIV宽度和高度在设置innerHTML时不会调整大小?
发布评论