我有一个html代码:
<div style="width:100%;word-wrap:break-word;;" align="justify">
<p style="text-align: justify;" align="justify">
<img class="news-image" alt=" Thời trang"
src="http://img-hcm.24hstatic.com/upload/3-2012/images/2012-09-13/1347508625-lan-khue1.jpg"
style="font-size: medium; font-family: "Times New Roman";max-width:95%;">
</p>
</div>
我不知道为什么 img
的 max-width
不起作用。如果我删除 p
标签,它就可以工作。
无论如何要在 p
标签内使用 max_width
。
最佳答案
你不能在你的字体周围使用双引号 "
它会破坏 html 使用单数 '
代替
变化:
<img class="news-image" alt=" Thời trang"
src="http://img-hcm.24hstatic.com/upload/3-2012/images/2012-09-13/1347508625-lan-khue1.jpg"
style="font-size: medium; font-family: "Times New Roman";max-width:95%;">
收件人:
<img class="news-image" alt=" Thời trang"
src="http://img-hcm.24hstatic.com/upload/3-2012/images/2012-09-13/1347508625-lan-khue1.jpg"
style="font-size: medium; font-family: 'Times New Roman';max-width:95%;">
关于html - 在 p 标签内具有最大宽度的 Img 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12419559/