Fit an image based on the height of a cell in HTML

0

Good afternoon

Is it possible to make an image that I have inside a cell fit the size of the latter?

I want to shadow a table that I have in HTML-based mail, but this type of mail does not allow the box-shadow property: , that's why I'm replacing it with an image of shadow.

I relied on the following question: link

The lateral shadow is already positioned and displayed, but I can not make it fit the size of the cell.

Any ideas?

Thank you in advance.

    
asked by mslash 30.07.2017 в 02:22
source

1 answer

0

The strict answer to your question is to put position: relative to the cell, and display: block, width: [the size of the image in pixels], and height: 100% to the image. That would stretch it as you need.

The issue is that Gmail eliminates the position: relative of the mails, so it's a bad idea to use it in a template:

link

The alternative in this case is to use the image as the background of the cell. Gmail supports it, but many versions of Outlook do not. In fact, any smart trick to solve this problem is going to hit Outlook, but you can check the compatibility list yourself:

link

The reality is that in general it is a bad idea to make stylistic innovations in an e-mail template. The support of CSS and HTML is very poor, and also very little between different clients. Better limit yourself to the basics.

    
answered by 02.08.2017 / 07:52
source