1

我有一个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>

我不知道为什么不 max-width工作img。如果我删除p标签,它会起作用。无论如何要使用max_width内部p标签。

4

1 回答 1

2

您不能"在字体周围使用双引号,它会破坏 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%;">
于 2012-09-14T07:02:32.340 回答