Inheriting css on wordpress pages from Theme - html

Desperately looking for help with determining if there is the possibility to ignore css styles on my wordpress website?
My friend asked me for help in creating the site of his new company at the beginning I wanted to refuse but it is a good friend, so I thought "I will install wordpress, a few clicks and done". Now it has come to me how much I have underestimated the frontend devs and through what hell they are going through to ensure the responsiveness of the site with the help of this ... css.
I apologize for this introduction but for a few hours I am trying to make a very simple responsive table in html. It turned out that I'm doing everything correctly but my wordpress skin changes the style of almost all tags that I want to use, for example, table, tr, td and to "reset" the css style for this element my html fragment instead of clean nice html is HELL!
Every html element inherits from theme and I have to "reset" it to "default" values.
<table style="border: none; vertical-align: initial; table-layout: fixed; padding: 10px 10px 10px 10px;" cellpadding="5">
<tbody>
<tr>
<td style="border: none;">
<table style="border: none !important; vertical-align: middle; border-collapse: collapse; border-color: #ddddddd;" cellpadding="5">
<tbody style="border: none;">
<tr>
<th style="border-color: #21288f; text-align: center;" colspan="2"><span style="border: none; color: #21288f; text-align: center;"> FACILITY MANAGEMENT </span></th>
<th style="border: none;"></th>
</tr>
<tr style="border: none; vertical-align: middle; padding-bottom: 0px; padding: 10px 10px 10px 10px; display: block margin-bottom: 0em; height: 10%;" valign="middle">
<td style="border: none; padding: 10px 10px 10px 10px; vertical-align: middle; display: block margin-bottom: 0em;" valign="middle"><img style="min-width: 30px; min-height: 30px; ;vertical-align: middle; margin-bottom: 0px;" alt="" width="50" height="50" /></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; display: block margin-bottom: 0em;" valign="middle"><span style="color: #21288f;">TEXT1</span></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; display: block margin-bottom: 0em;" rowspan="6" valign="middle"></td>
</tr>
<tr style="border: none; vertical-align: middle; padding-bottom: 0px; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle">
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle"><img style="vertical-align: middle; margin-bottom: 0px;" alt="" width="50" height="50" /></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em; height: 10%;" valign="middle"><span style="color: #21288f;">TEXT2</span></td>
</tr>
<tr style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle">
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle"><img style="vertical-align: middle; margin-bottom: 0px;" alt="" width="50" height="50" /></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em; height: 10%;" valign="middle"><span style="color: #21288f;">TEXT3</span></td>
</tr>
<tr style="border: none; vertical-align: middle;">
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle"><img style="vertical-align: middle; margin-bottom: 0px;" alt="" width="50" height="50" /></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em; height: 10%;" valign="middle"><span style="color: #21288f;">TEXT4</span></td>
</tr>
<tr style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle">
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle"><img style="vertical-align: middle; margin-bottom: 0px;" alt="" width="50" height="50" /></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em; height: 10%;" valign="middle"><span style="color: #21288f;">TEXT4</span></td>
</tr>
<tr style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle">
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em;" valign="middle"><img style="vertical-align: middle; margin-bottom: 0px;" alt="" width="50" height="50" /></td>
<td style="border: none; vertical-align: middle; padding: 10px 10px 10px 10px; margin-bottom: 0em; height: 10%;" valign="middle"><span style="color: #21288f;">TEXT4</span></td>
</tr>
</tbody>
</table>
</td>
<td style="border: none;"><img class="wp-image-630 aligncenter" alt="" width="322" height="255" />
<img class="wp-image-631 aligncenter" alt="" width="311" height="240" />
</td>
</tr>
<tr>
<td style="border: none;"></td>
<td style="border: none;"></td>
</tr>
</tbody>
</table>
I will take every advice on how to deal with it so that my posts do not inherit from the wordpress theme.

I would recommend to first look at the themes documentation, you may provide a link to the site or more specific information.
Maybe the theme provides some options or a tutorial for a child theme?
Anyways. Inline css attributes are taken over all but they may not be neccessary (sometimes they are)
Take a look at css specificity: https://css-tricks.com/specifics-on-css-specificity/
You need to find out what css selectors are beeing used to style the tables (browser dev tools) and then make stronger ones that overrides them, even if they are parsed before them.
you then can put them in a <style> tag before the table or somewhere else in a css file that gets not overwritten by updates(Child theme)
Update: after looking at https://demo.themegrill.com/spacious/wp-content/themes/spacious/style.css from the themes demo there is the table styling starting from line 54
you should be able to override it with
body table {
/* original values
border-collapse: collapse;
border-spacing: 0;
margin: 0 0 1.5em;
width: 100%;
*/
}
body th {
/* original values
font-weight: bold;
border: 1px solid #EAEAEA;
padding: 6px 10px;
*/
}
body td {
/* original values
border: 1px solid #EAEAEA;
padding: 6px 10px;
*/
}
body caption,
body th,
body td {
/* original values
text-align: left;
*/
}
the easiest way for you is put that css into the themes Custom CSS option as this is a feature promoted here: https://themegrill.com/themes/spacious/#all-features

Related

My pixels aren't displayed correcly in a button in Outlook desktop for an email html?

I am trying to create a buttoon centered vertically in Outlook, I am using a code that another developer worked on, and trying to re-adapt it
in the code I am trying to set fixed values to avoid any issues but in outlook it displays extra space
in Outlook web, mobile, Gmail, browsers, etc, this is good and expected :
in Outloook Desktop :
This is the logic I am setting witgh my html code :
Border with 1 px and two spacers rows with 8px, and text container with line-height: 18px; ..
This is my HTML
<tr>
<td valign="middle" style="padding: 0px; vertical-align: middle;height:35px;" align="center" height="35">
<table
style="border-collapse: collapse; border-spacing: 0; -webkit-text-size-adjust: none;height:35px;"
cellspacing="0" cellpadding="0" border="0" height="35">
<tr>
<td valign="middle" border="1" class="borders" dir="ltr"
style="padding: 0px; vertical-align:middle; border: 1px solid #4E4E4E; border-image: none; width: 220px; height: 34px; text-align: center; color: #4B4B4B; text-transform: uppercase; text-decoration: none; vertical-align: middle; background-color: #EBEBEB;"
bgcolor="#303335" align="center" height="34">
<table
style="border-collapse: collapse; border-spacing: 0; -webkit-text-size-adjust: none;"
cellspacing="0" cellpadding="0" border="0">
<tr>
<td dir="ltr"
style="padding: 0px; border-image: none; width: 220px; height: 8px; text-align: center; color: #4B4B4B; text-transform: uppercase; text-decoration: none; background-color: #ffffff;vertical-align: middle;"
valign="middle" height="8" bgcolor="#ffffff" align="center">
</td>
</tr>
<tr>
<td dir="ltr"
style="padding: 0px; border-image: none; width: 220px; text-align: center; color: #4B4B4B; text-transform: uppercase; text-decoration: none; line-height: 18px; font-size: 15px; background-color: #EBEBEB;vertical-align: middle;"
valign="middle" bgcolor="#303335" align="center">
<a href="%%=RedirectTo(CONCAT( TreatAsContent(#contentblock_link), '&utm_clickposition=cta', TreatAsContent(#contentblock_link_anchor)))=%%"
style="color: #4B4B4B ; text-transform: uppercase; vertical-align: middle; line-height: 18px; letter-spacing: 0.5px; font-family: "HelveticaNeueLight", Helvetica, Arial, sans-serif; font-size: 15px; text-decoration: none; display: inline-block; ">%%=Field(#campaign_input_data,
concat(#contentblock, '_cta'))=%%</a>
</td>
</tr>
<tr>
<td dir="ltr"
style="padding: 0px; border-image: none; width: 220px; height: 8px; text-align: center; color: #4B4B4B; text-transform: uppercase; text-decoration: none; background-color: #ffffff;vertical-align: middle;"
valign="middle" height="8" bgcolor="#ffffff" align="center">
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
It looks like your third row is expanding. I believe what is happening is Outlook is inserting a blank paragraph - though why that is not happening in the first row too is a mystery.
To ensure the right height for a blank row (in between the <td>'s), use the following construction:
<p style="margin:0;padding:0;font-size:8px;line-height:8px;"> </p>
Also ensure there are no spaces in between the <td>'s. I would use that on both the top and bottom row, for consistency. (Once you do this, you don't need the height: 8px; in the <td> style.)

Why is my image in email template not properly aligned?

How can I fix my margin and padding section in the email template to properly align my images in different columns ?
I have inserted a full image and also partial code below. Thank you.
<tr>
<td valign="top" align="middle" >
<table border="0" cellpadding="0" cellspacing="0" width="100%;
background-color: #ffffff; padding; 20px;">
<tr>
<td bgcolor="#ffffff" style="display: inline-block; max-width: 270px; width: 100%;" align="center">
<img src="https://i.postimg.cc/sgw9MVx8/jug.png" alt="" style="max-width: 268px; width: 100%" border: 1px solid: #d5d5d5 />
<h3 style="margin: 10px 0px; font-family: sans-serif; font-size: 20px; color: #000000" > Jug </h3>
<p style="margin: 0; font-size: 16px; color: #444444; margin-bottom: 10px; "> 10% discounts</p>
</td>
<td style="display: inline-block; max-width: 20px; width: 100%" >
</td>
<td bgcolor="#ffffff" style="display: inline-block; max-width: 270px; width: 100%;" align="center">
<img src="https://i.postimg.cc/CK9LqX9G/apple.jpg" alt="" style="max-width: 268px; width: 100%" border: 1px solid: #d5d5d5 />
<h3 style="margin: 10px 0px; font-family: sans-serif; font-size: 20px; color: #000000" > Apple </h3>
<p style="margin: 0; font-size: 16px; color: #444444; margin-bottom: 10px; "> 10% discounts</p>
</td>
</tr>
</table>
</td>
</tr>
Both Images resolution should be of the same size.

HTML Email : Images go beyond its limited width in outlook

I have these images. they work fine in Gmail , but when I see in outlook , then all the 5 images comes in single <tr> and extends the default width of table.
What I want is , first four images should be in the center of first line and if there are more images then , it should be in new line. but in the same <tr>. I don't want separate <tr>for the same. I have done this. It looks fine in Gmail. but it extends its width in outlook which I have to make them correct. I have read article regarding the same. but didn't get too much.
So , It would be great , If I get help for this issue.
Thank You.
<table width="600" cellspacing="0" cellpadding="0" border="0" style=" background: #fa4b00;margin: 0 auto !important; padding: 0px; max-width:600px !important; line-height: 100% !important; border-collapse: collapse;mso-table-lspace: 0pt;mso-table-rspace: 0pt; text-align: center;" >
<tr>
<td height="20"></td>
</tr>
<tr>
<td style="vertical-align:top;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center;">
<img style=" outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455301580.jpeg" border="0" height="120" width="120" >
<p style=" width: 100%; text-align:center; font-size:10px;word-break: normal; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; color: #ffffff; font-weight: 600; ">XYZ</p>
<p style=" width: 100%; text-align:center; font-size:8px;word-break: normal; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; color: white; "> XYZ </p>
</td>
<td style="vertical-align:top;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center;">
<img style=" outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455949782.jpeg" border="0" height="120" width="120" >
<p style=" width: 100%; text-align:center; font-size:10px;word-break: normal ; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; color: #ffffff; font-weight: 600;">XYZ</p>
<p style=" width: 100%; text-align:center; font-size:8px; word-break: normal ; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; color: #FFFFFF;"> XYZ </p>
</td>
<td style="vertical-align:top;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center;">
<img style=" outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455627060.jpeg" border="0" height="120" width="120" >
<p style=" width: 100%; text-align:center; font-size:10px;word-break: normal; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; color: #ffffff; font-weight: 600;">XYZ</p>
<p style=" width: 100%; text-align:center; font-size:8px;word-break: normal; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; color: #FFFFFF;">XYZ </p>
</td>
<td style="vertical-align:top;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center;">
<img style=" outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455300140.jpeg" border="0" height="120" width="120" >
<p style=" width: 100%; text-align:center; font-size:10px;word-break:normal; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; color: #ffffff; font-weight: 600;">XYZ</p>
<p style=" width: 100%; text-align:center; font-size:8px;word-break: normal; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; color: #FFFFFF;"> XYZ </p>
<p style="padding-bottom: 30px;"></p>
</td>
<td style="vertical-align:top;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center;">
<img style=" outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455300140.jpeg" border="0" height="120" width="120" >
<p style=" width: 100%; text-align:center; font-size:10px;word-break:normal; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; color: #ffffff; font-weight: 600;">XYZ</p>
<p style=" width: 100%; text-align:center; font-size:8px;word-break: normal; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; color: #FFFFFF;"> XYZ </p>
<p style="padding-bottom: 30px;"></p>
</td>
</tr>
</table>
You're setting the TDs to display:inline-block, which doesn't really make much sense for a table element. The whole point of a table cell is that it behaves like a table cell.
Maybe that's what the issue is; if you're using an Outlook app or whatever it'll have a different rendering engine to Chrome. So that rendering engine could decide to ignore display:inline-block on table cells.
I'm pretty sure if you just removed the table stuff and wrapped each image in a DIV instead it would work reliably.
jsFiddle

HTML Email : Transparent Layer of Text to the bottom of the image

I want a transparent text layer to the bottom of image.
<table>
<tr>
<td style="vertical-align:top; background:#ffffff;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center; background: #FFFFFF;">
<img style=" padding-top:10px; outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455301580.jpeg" border="0" height="110" width="110" >
<!--
<p style=" width: 100%; text-align:center; font-size:10px;word-break: break-all; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; background: #EE163A;">Mr. Mahesh Murthy</p>
<p style=" width: 100%; text-align:center; font-size:8px;word-break: break-all; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; background: #EE163A;">
Co-founder at seefund
</p>-->
</td>
</table>
I don't know how to do without using position property.
PS: I am making HTML Emailer , so have to use table tag and inside css only. Can not use div , position property.
Thank You.
<table>
<tbody>
<tr>
<td style="vertical-align:top; background:#ffffff;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center; background: #FFFFFF;">
<div style="width: 110px; height: 110px;">
<img style=" padding-top:10px; outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455301580.jpeg" border="0" height="110" width="110">
<p style="width: 100%;text-align:center;font-size:10px;word-break: break-all;/* text-transform: uppercase; */max-width: 110px;padding: 0px 5px;margin: 0 auto;background: rgba(45, 41, 42, 0.5);color: white;position: relative;bottom: 25px;">Mr. Mahesh Murthy</p>
<p style="width: 100%;text-align:center;font-size:8px;word-break: break-all;/* text-transform: uppercase; */max-width: 110px;padding:0px 5px;padding-right: 5px;margin: 0 auto;position: relative;bottom: 25px;background: rgba(45, 41, 42, 0.5);color: white;"> Co-founder at seefund </p>
</div></td>
</tr>
</tbody>
</table>
Something like that, but is that really not possible to use the position ? Because you won't be able to move it to the top. You might need to add a z-index property, requied position too.
<table>
<tr>
<td style="vertical-align:top;width:20%;display:inline-block;margin-left:20px;padding:0;text-align:center; background: #FFFFFF;"><img style=" padding-top:10px; outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;" alt="" src="http://www.hubilo.com/eventApp/ws//images/speaker/profile/thumb/2712_1455301580.jpeg" border="0" height="110" width="110" >
<p style=" width:100px; text-align:center; font-size:10px;word-break: break-all; text-transform: uppercase; max-width: 110px; padding: 0px 5px; margin: 0 auto; background: #EE163A; background:rgba(255,200,255,0.5); position:relative; top:-25px;">Mr. Mahesh Murthy</p>
<!-- <p style=" width: 100%; text-align:center; font-size:8px;word-break: break-all; text-transform: uppercase; max-width: 110px; padding:0px 5px; padding-right: 5px; margin: 0 auto; background:rgba(150,150,150,0.5); position:relative; top:-10px;"> Co-founder at seefund </p>--></td>
</table>

Issue with listing td's as inline-block elements in table in chrome

Has anyone any pointers for a problem that I am having in Chrome (iPhones too, when scaled) with the table structure in this email template?
All of the four td's have fixed width's but are not responding correctly. They should all stack inline as a list. Instead they are skewing and am struggling to work out the inheritance.
<tr>
<td height="40" style=
"float: none; clear: both; font-size: 1px; line-height: 1px; margin: 0px auto; display: inline-block;"
width="50">
<a href="http://cornermag.com/appstore"><img src=
"http://www.cornermag.com/mailouts/issue6/getexcited/desktop/icon_facebook.png"
style=
"float: none; display: block; margin: 0px auto; clear: both;"></a>
</td>
<td height="40" style=
"float: none; clear: both; font-size: 1px; line-height: 1px; margin: 0px auto; display: inline-block;"
width="50">
<a href="http://cornermag.com/appstore"><img src=
"http://www.cornermag.com/mailouts/issue6/getexcited/desktop/icon_twitter.png"
style="float: none;clear: both;display: block;margin: 0 auto;"></a>
</td>
<td height="40" style=
"float: none; clear: both; font-size: 1px; line-height: 1px; margin: 0px auto; display: inline-block;"
width="50">
<a href="http://instagram.com/cornermagazine"><img src=
"http://www.cornermag.com/mailouts/issue6/getexcited/desktop/icon_instagram.png"
style="float: none;clear: both;display: block;margin: 0 auto;"></a>
</td>
<td height="40" style=
"float: none; clear: both; font-size: 1px; line-height: 1px; margin: 0px auto; display: inline-block;"
width="50">
<a href="www.pinterest.com/cornermagazine/"><img src=
"http://www.cornermag.com/mailouts/issue6/getexcited/desktop/icon_pintrest.png"
style="float: none;clear: both;display: block;margin: 0 auto;"></a>
</td>
</tr>
Link: http://www.cornermag.com/mailouts/issue6/getexcited/new2.html
Any pointers would be a great help.