<div style="position: relative">
<img src="http://52.66.90.164/Show_barcode">
<div stule="position: absolute;top:100%;">
<p style="float:left;width: 33.33%">Hello world my name is Rushabh Shah.</p>
<p style="float:left;width: 33.33%">Hello world my name is Rushabh Shah.</p>
<p style="float:left;width: 33.33%">Hello world my name is Rushabh Shah.</p>
</div>
</div>
我想要 33.33% 的图像而不是父 div。我怎样才能做到这一点?图像宽度和高度是动态的。
仅当您可以float: left;
在图像容器上进行设置时才有可能,div
如下所示:
<div style="position:relative; float:left;">
<img src="http://via.placeholder.com/650x150">
<div style="position:absolute; width:100%; left:0; top:100%;">
<p style="float:left;width: 33.33%">Hello world my name is Rushabh Shah.</p>
<p style="float:left;width: 33.33%">Hello world my name is Rushabh Shah.</p>
<p style="float:left;width: 33.33%">Hello world my name is Rushabh Shah.</p>
</div>
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句