transform与绝对定位元素包含块实例页面
展示
代码
-
HTML:
<p> <img src="1.jpg"> </p>
-
CSS:
p { border: solid deepskyblue; width: 150px; height: 150px; transform: scale(1); } p > img { width: 100%; position: absolute; }
<p> <img src="1.jpg"> </p>
p { border: solid deepskyblue; width: 150px; height: 150px; transform: scale(1); } p > img { width: 100%; position: absolute; }