html - css background-image doesn't work on table object -
in django app put background image in table. problem image doesn't show. code:
<table style="background-image: url('/static/assets/img/myimage.png') ;background-position: 0 100% !important;background-repeat: repeat-x ;background-size: 40px 3px"> hello! </table>
if put same css style in div object work. eg:
<div style="background-image: url('/static/assets/img/myimage.png') ;background-position: 0 100% !important;background-repeat: repeat-x ;background-size: 40px 3px"> hello! </div>
where mistake? lot help
edit1
i insert email html file in django template. use 'include' , works image doesn't works background-image style. image location correct (if use 'div' , not 'table' works). have bootstrap
edit2
this complete code. in table don't see background image
<!-- ======= section ======= --> <table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="34302d" style="background-image: url('http://themastermail.com/envato/omail/demo/layout2/img/testi-bg.jpg') !important; background-size: cover; background-position: top center; background-repeat: no-repeat;" background="http://themastermail.com/envato/omail/demo/layout2/img/testi-bg.jpg"> <tr><td height="60" style="font-size: 60px; line-height: 60px;"> </td></tr> <tr> <td align="center"> <table border="0" width="590" align="center" cellpadding="0" cellspacing="0" class="container590"> <tr> <td> <table border="0" width="580" align="center" cellpadding="0" cellspacing="0" class="container580"> <tr> <td align="center" style="color: #b9bcc7; font-size: 16px; font-family: 'open sans', calibri, sans-serif; line-height: 30px;" class="title_color"> <!-- ======= section text ====== --> <div style="line-height: 30px"> <em>proin eget massa tincidunt, lobortis ex nec, placerat odio. mauris gravida nulla id laoreet ornare. maecenas sagittis elit metus, eget pellentesque couleur non categorize rouge vert bleu.</em> </div> </td> </tr> </table> </td> </tr> <tr><td height="35" style="font-size: 35px; line-height: 35px;"> </td></tr> <tr> <td align="center"> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left" width="80"> <a href="" style=" border-style: none !important; border: 0 !important;"><img src="http://themastermail.com/envato/omail/demo/layout2/img/testi-img.png" style="display: block; width: auto;" width="70" border="0" alt=""/></a> </td> <td align="left" style="color: #ffffff; font-size: 14px; font-family: raleway, calibri, sans-serif; mso-line-height-rule: exactly; line-height: 24px;" class="title_color"> <!-- ======= section header ======= --> <div style="line-height: 24px;"> marta clarcks<br><a href="" style="color: #f29a27; text-decoration: none;">envato.com</a> </div> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr><td height="60" style="font-size: 60px; line-height: 60px;"> </td></tr> </table> <!-- ======= end section ====== -->
you left out !
on !important
tag.
<table style="background-image: url('/static/assets/img/myimage.png') !important;background-position: 0 100% !important;background-repeat: repeat-x !;background-size: 40px 3px"> hello! </table>
but you've not got tr
, td
etc in field may still not display it, should try:
<table style="background-image: url('/static/assets/img/myimage.png') !important;background-position: 0 100% !important;background-repeat: repeat-x !;background-size: 40px 3px; display: block;"> <tr> <td> <p>hello</p> </td> </tr> </table>
Comments
Post a Comment