The CreatorCon Call for Content is officially open! Get started here.

How to set the correct height & width of banner logo in Notifcation

shaik_irfan
Tera Guru

Hi,

 

I have a banner image which i want to place in the header of the notification, i saved the image in images table and i called in notification script as shown below:

 

The source which i received from the image i pased down here

 

<img src="Gmy_banner.png" width="2500" height="625"/>

 

When i called the notification script in the Notifcation and when i see the preview the banner is very biggggg

How to set the correct width & heigth which match the body of the email ?

8 REPLIES 8

Omkar Mone
Mega Sage

Hi 

The width and height of the img tag take the values in pixels. So according to your code, 2500 pixels for width and 625 pixels for height is a very big resolution. I would recommend you to try giving lesser pixels or try with this once - 

<img src="Gmy_banner.png" width="100%" height="auto"/>

 

Hope this helps.

 

Regards

Omkar Mone

Width is perfect Omakr, but the heigth is little bigger, is there any option for setting the height ?

try to give same height and width here. 

 

eg:

 

<img src="Gmy_banner.png" alt="Smiley face" width="42" height="42">

 

lots of example available on google, you can try to have look there. 

 

https://www.w3schools.com/tags/att_img_width.asp

http://www.tagindex.net/html/img/img_width.html

In your post I see that the image width is at least 2500 and the height is 625. Very big.

Nothing is wrong with that except that (keep in mind I don't know what the image looks like) if the image itself isn't of anything abstract then you'll want to keep the ratio proportionate. Otherwise it's will look strange.

Omkar's solution would be best because it's using percentage to make the image auto adjust it's size and leaving the height to auto so that the height will keep its proportion nice looking. Since the image is huge then depending upon the width the height could still be huge.

If the image doesn't need to be proportionate then set the height to the desired size.