hiepnh
hiepnh

Reputation: 447

Img with max-width inside p tag doesn't work

I have a html code:

  <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>

I don't know why max-width of img dosen't work. If I remove p tag, it works. Is there anyway to use max_width inside p tag.

Upvotes: 1

Views: 894

Answers (1)

Breezer
Breezer

Reputation: 10490

You can't use double " quotation mark around your font it breaks the html use singular ' instead

change:

<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%;">

TO:

<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%;">

Upvotes: 2

Related Questions