Author Topic: [solved] Img size in html msg. body  (Read 1735 times)

Offline lacosta

  • Newbie
  • *
  • Posts: 2
[solved] Img size in html msg. body
« on: January 26, 2017, 02:44:03 AM »
Hi, where i can add option max-width: 100% to img style ? This code is generated by php, this is not in css. Most of phone app client add picture to html body not as attachment. Problem is size of pictures, when 2K and more res. is over preview container.

Code: [Select]
<div class="rcmBody">
 <div>
    <img style="width: auto; height: auto;" alt="Image" src="./?_task=mail&amp;_action=get&amp;_mbox=INBOX&amp;_uid=xxxxxxx&amp;_token=xxxxxxxxxxxxxxxxxx&amp;_part=2&amp;_embed=1&amp;_mimeclass=image">

Solution is :

Code: [Select]
<div class="rcmBody">
 <div>
    <img style="width: auto; height: auto; max-width: 100%;" alt="Image" src="./?_task=mail&amp;_action=get&amp;_mbox=INBOX&amp;_uid=xxxxxxx&amp;_token=xxxxxxxxxxxxxxxxxx&amp;_part=2&amp;_embed=1&amp;_mimeclass=image">
« Last Edit: January 26, 2017, 04:37:37 PM by lacosta »

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,541
    • http://SKaero.com/
Re: Img size in html msg. body
« Reply #1 on: January 26, 2017, 09:20:43 AM »
I think that html would be part of the email message not part of the Roundcube code. The bast way to add a max-width would be to add a css file with the following:
Code: [Select]
.rcmBody img {
max-width: 100%;
}

Offline lacosta

  • Newbie
  • *
  • Posts: 2
Re: Img size in html msg. body
« Reply #2 on: January 26, 2017, 04:36:55 PM »
It works ! Thank you ...