I am creating an HTML email template. The desktop version is performed using tables, several built-in css, all sizes are determined in% or px values.
For the mobile version, I work with divs and css. Now I would like to resize some texts depending on the width of the viewport. Because if I define some header font size to say 28px, then certain text may look OK on a wider device, but on a smaller device, the text gets large and breaks onto the next line.
Now I consider setting the base font size as follows: (run the fragment in full screen mode, and then resize the window to see the effect)
:root { font-size: calc(8px + 4vw); }
<h1> Header 1 </h1> <h2> Header 2 </h2> <p> Lorem ipsum dolor sit amet, quo eripuit menandri instructior ad, nostro iracundia nam at. Etiam quaerendum vis no. Percipit accommodare ne eum. Alia molestie democritum vix no, natum habemus ei eum, qui ut adhuc partem luptatum. </p>
Similarly, subsequent font sizes are scaled depending on the width of the viewport, the title becomes smaller on smaller devices, preventing text breakage or making it less likely. Using calc (), I also define a certain minimum, so the text will not get too small.
Now my question is: is it ok to use this for email (mobile), or is it poorly supported by mobile email clients? Browser support is not bad, but I could not find information on mobile email client support.
source share