Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以使 div 中的图像采用形状或另一个图像内的形式?谢谢
我能想到的唯一解决方案是获取图像的宽度和高度,然后将这些值分配给你想要调整大小的 div:
var imgWidth = $('#imageid').width(); var imgHeight = $('#imageid').height(); $('#divId').css("height", imgHeight ); $('#divId').css("width", imgWidth);