Essential HTML Responsive Tricks


  • Use class='hide' (css - display: none !important ;) to hide a table, table row, image or any element where it is not required.
  • Keep maximum width of tables to 610px
  • Use transparent .gif images to keep the gaps between elements (eg: tables)
  • You can cheat by putting a different width to an images against actual (eg: width=195 for images of actual width 300px)


To have two horizontal blocks, create two tables of width 300px inside a table of width 610. First nested table must aligh left and second nested table must align right.


If mobile only element (especially image) is not visible in MS Outlook, keep that element inside the following code:
<!--[if !mso]><!-->

<!--<![endif]-->



To have three horizontal blocks, Create three separate tables inside a table of width 610.
First table with width 195 should align left. It should have a right column to accommodate a spacer image of width 12px.
Second tabke width 195 should align left.
Third table width 195 should align right.
While inserting images put width as 195 for images of  actual width 300


To have four horizontal blocks, Create a parent table of width 610 that align center.
Create two first-level child tables of width 300 each; first align left and second align right.
Create two second-level child tables of width 145 in each first-level child tables that is aligned to left
In between the two first-level child tables, insert the following code to satisfy MS Outlook
<!--[if mso]></td><td><![endif]-->

Comments

Popular posts from this blog

How to select and cut out an image in Krita

Transform and Stretch an image in Krita

Joomla error: Your site may not have been upgraded completely