I'm trying to apply responsive design in sendGrid. When I preview it in the website preview it is working, but when I send the test email and view it on mobile, I see that the #media screen has not been applied. Does anyone know what could be happening?
{{#if rewardData.deals.[0].coupon}}
<style>
#media screen and (max-width:300px) {
.teste {
width: 100% !important;
}
.firstDiv {
display: inline-block !important;
}
}
</style>
<div class="firstDiv" style="display: flex;
align-items: center;
border: 1px solid #D9D9D9;
border-radius: 8.49px;
padding: 16px;
margin: 35px 35px 25px 28px;">
<div class="teste" style="text-align:left; display: inline-block; margin-right: 16px">
<img class="max-width" style="border-radius: 8px" data-proportionally-constrained="true" data-responsive="false" src="{{rewardData.deals.[0].wideBanner}}" alt="Banner da recompensa">
</div>
<div class="teste" style="display: inline-block;">
<div style="display: flex; align-items: center; margin-bottom: 14px">
<img style="border-radius: 8px; margin-right: 8px" width="32" src="{{rewardData.deals.[0].icon}}" alt="Logo da recompensa">
<p style="display: inline-block; vertical-align: super">{{rewardData.deals.[0].title}}</p><br>
</div>
<b style="font-size: 12px; text-align: left; color: #2B332E">{{rewardData.deals.[0].shortDescription}}</b><br><br>
<b style="font-size: 12px; text-align: left;">Resgatar recompensa</b>
</div>
</div>
<div style="font-family: inherit; text-align: inherit; color: #000000; font-family: helvetica, monospace; font-size: 14px; margin-bottom: 50px; margin-top: 25px; margin-bottom: 25px; padding: 0px 40px">
<img class="max-width" border="0" style="color: #000000; text-decoration:none; font-family:Helvetica, arial, sans-serif; font-size:16px; vertical-align: bottom;" width="16" alt="" data-proportionally-constrained="true" data-responsive="true" src="http://cdn.mcauto-images-production.sendgrid.net/92d7128873c0e80b/6ee5ec4b-aaad-46cb-9c96-d5d61fb7231d/72x72.png">
<strong style="padding-left: 5px">Como usar minha recompensa?</strong><br><br>
<div style="line-height: 18px">
{{rewardData.deals.[0].description}}
<b>Seu voucher tem validade de até 30 dias para ser usado.</b>
</div>
</div>
{{/if}}
Many email clients do not support #media statements.
The website preview is a useful tool to preview your work, however it cannot show how an email will render across different mail clients.
Is there a way you can achieve your responsivenice without a media query?
Many mobiles are more than 300px wide, so try increasing the max-width from 300 to about 450.
Otherwise, take note of which email client you sent to and whether it supports media queries: https://www.caniemail.com/features/css-at-media/
There's quite a lot of code you use that is not supported. Email has an added layer or two to web design, in that email clients only accept a subset of HTML & CSS - more akin to HTML4 and CSS2, but there are lots of exceptions.
So, it may also not be working because flex is not supported, or align-items (flex is more widely supported, but all of the other parts of flexbox like align-items are very poorly supported).
I'd suggest you take a totally different approach and you'd need to research how to do a responsive HTML email as the topic is much too large for one question.
Related
I'm trying to design a header for an email newsletter that will be sent on Mailchimp. I've managed to make it the way I want it to be on the mail editor, however, when testing on other readers, the header goes completely bollocks. I believe the problem is on the positioning of elements, is that so?
I have tried several CSS positions combinations without any major success.
.header {
background-color: #5724a9 !important;
width: 100%;
height: auto;
min-height: 14em;
min-width: 600px;
position: relative;
}
.VER {
font-family: Arial;
font-size: 10px;
font-weight: normal;
font-style: italic;
font-stretch: normal;
line-height: 1.8;
letter-spacing: normal;
text-align: left;
color: #ffffff;
position: absolute;
top: 3%;
left: 3%;
word-wrap: break-word;
}
.logo {
width: 28%;
max-height: 12em;
object-fit: contain;
float: left;
position: absolute;
padding-top: 2em;
padding-left: 14.5em;
padding-right: 14.5em;
}
<div class="header">
<p class="VER">Ver este email no browser</p>
<a href="https://www.instagram.com/desembola/" style="text-decoration: none; display: inline-block"><img src="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/38baf9eb-8971-4232-8877-e821fb206396.png" srcset="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/929291fe-8e66-433a-893d-860c863dd597.png 2x,
https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/0668c4e9-df06-42cd-a8fb-0125371d2478.png 3x" class="instagram"></a>
<a href="https://www.facebook.com/desembolanews/" style="text-decoration: none;display: inline-block"><img src="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/d29b31ac-a288-47a3-aa9c-d2ab0b650374.png" srcset="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/e92c4f99-3f9a-4676-af77-0fa93f54c0e6.png 2x,
https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/abb16351-fc77-4bf5-b34c-efa005ee76fe.png 3x" class="facebook"></a>
<img src="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/7ab88f02-314e-4cc7-bbeb-0d3d216d1dac.png" srcset="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/433683ea-5f9d-4d3a-ac8c-ab0d4a6de392.png 2x, https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/e9d7c117-efdb-448c-aa7a-bdbe0a3ad2f5.png 3x" class="spotify">
Expected:
Reality (on different browsers):
Unfortunately e-mails are rendered in a very primitive way. Using divs and separate style declarations will most probably not work in most e-mail clients.
For starters you will have to use table layouts. Some best practices here
And you will have to inline all your CSS, mailchimp tool: here
It's not worth your time trying to develop HTML emails like you would develop a website.
Once you make a start on the above, it should be easier for you to define specific problems with development.
Here is an example of how it can be done. Basically 3 columns with images and links in different columns.
You have to remember, emails are not web pages. Each element should have its own CSS inlined. Media query and global CSS can be in the head of the document but not all CSS will be read by all email clients. Check out the best CSS guide created by Campaign Monitor sometime ago. Its the best resource to start with when it comes to CSS.
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="purple">
<tbody>
<tr>
<td width="200"> <p class="VER">Ver este email no browser</p></td>
<td align="center" style="color:#ffffff;">Logo here</td>
<td width="100">
<a href="https://www.instagram.com/desembola/" style="text-decoration: none; display: inline-block"><img src="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/38baf9eb-8971-4232-8877-e821fb206396.png" srcset="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/929291fe-8e66-433a-893d-860c863dd597.png 2x,
https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/0668c4e9-df06-42cd-a8fb-0125371d2478.png 3x" class="instagram"></a>
<a href="https://www.facebook.com/desembolanews/" style="text-decoration: none;display: inline-block"><img src="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/d29b31ac-a288-47a3-aa9c-d2ab0b650374.png" srcset="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/e92c4f99-3f9a-4676-af77-0fa93f54c0e6.png 2x,
https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/abb16351-fc77-4bf5-b34c-efa005ee76fe.png 3x" class="facebook"></a>
<img src="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/7ab88f02-314e-4cc7-bbeb-0d3d216d1dac.png" srcset="https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/433683ea-5f9d-4d3a-ac8c-ab0d4a6de392.png 2x, https://gallery.mailchimp.com/82a2f49caf501fc10ae6ea563/images/e9d7c117-efdb-448c-aa7a-bdbe0a3ad2f5.png 3x" class="spotify">
</td>
</tr>
</tbody>
</table>
I have got some HTML code from investing.com below:
<iframe frameborder="0" height="380" width="230" src="https://ssltools.forexprostools.com/currency-converter/index.php?from=17&to=12&force_lang=1"></iframe><br /><table width="197"><tr><td><span style="font-size: 11px;color: #333333;text-decoration: none;">The Currency Converter is powered by Investing.com</span></td></tr></table>
The output is look like the picture below:
enter image description here
And I would like to add css to make the background like below:
Rounded rectangle, 30 opacity with light green, maybe 10 px for margins
enter image description here
Can anybody help me. I am new for html and css. Thank you very much.
Lawrence
just add wrapping div and css class .frame {} with colored border
.frame {
display: inline-block;
border: 30px solid ;
border-color: rgba(200,255,200,0.6);
border-radius: 30px;
margin: 10px;
}
<div class="frame"><iframe frameborder="0" height="380" width="230" src="https://ssltools.forexprostools.com/currency-converter/index.php?from=17&to=12&force_lang=1"></iframe><br /><table width="197"><tr><td><span style="font-size: 11px;color: #333333;text-decoration: none;">The Currency Converter is powered by Investing.com</span></td></tr></table></div>
<style>
.frame {
display: inline-block;
border: 30px solid ;
border-color: rgba(200,255,200,0.6);
border-radius: 30px;
margin: 10px;
}
</style>
<div class="frame"><iframe frameborder="0" height="380" width="230" src="https://ssltools.forexprostools.com/currency-converter/index.php?from=17&to=12&force_lang=1"></iframe><br /><table width="197"><tr><td><span style="font-size: 11px;color: #333333;text-decoration: none;">The Currency Converter is powered by Investing.com</span></td></tr></table></div>
I suggest you to put the iframe to a div. In this example .iframe-container. So the HTML will look like this:
<div class="iframe-container">
<iframe frameborder="0" height="340" width="210" src="https://ssltools.forexprostools.com/currency-converter/index.php?from=17&to=12&force_lang=1"></iframe>
</div>
<br />
<table width="197">
<tr>
<td>
<span style="font-size: 11px;color: #333333;text-decoration: none;">The Currency Converter is powered by Investing.com
</span>
</td>
</tr>
</table>
Please note that I changed the with and height of the iframe since the form it was containing, was not matched with the initial attributes. You can reset it if you'd like.
Then write some CSS as below:
.iframe-container {
display: inline-block;
margin: 30px;
padding: 30px;
background: rgba(0, 255, 0, .3);
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
}
iframe {
margin: 0;
padding: 0;
background: white;
}
See the result at jsFiddle.
Sorry! I know that is my problem that I tried many times to combine those HTML and css together, but doesn't work.
My purpose is only want to have "a batch of code" to paste into the website.
Thank you for your concern.
Div tags seem to be concluding on the wrong ending tag but I must've counted them a hundred times. I don't understand what's wrong. My boss says it needs to look good in Dreamweaver even though I've checked it in Mozilla, Safari and Chrome. Problem is that even though I'm using Sublime Text 2, some div tags are still showing that they conclude on the wrong closing div tag. So it looks all screwed up in Dreamweaver. Like I said, I must've counted it a hundred times and I'm at a complete loss. Does anyone have any suggestions? And also more importantly, any explanations for why this is happening in two different text editors? It might be something really silly that I'm doing but I just don't see what it is... Any help? The problem is most notable with the first opening div tag. On the way down it says it concludes at the bottom closing tag. But on the way up it says that the closing tag's source is somewhere in the middle. I just don't get it... UPDATED WITH THE CHANGES MADE. Now it looks better but the div tags still resolve on the wrong lines. Dreamweaver no longer is throwing an error but it still resolves in a weird way.
<style>
.landingWrapper{
font-family: Arial, sans-serif;
font-size: 14;
width: 784px;
display: block;
}
.blockIt {
display: block;
}
.clearIt {
clear: both;
min-height: 50px;
}
.margins {
margin-left: 35px;
margin-right: 35px;
}
.introText {
margin-bottom: 50px;
}
#listHeading {
background: #eceeef;
margin: 6px 13px;
}
#camera {
width: 354px;
height: 380px;
}
#camera, .listWrap {
display: inline-block;
}
.listWrap {
margin-left: 8px;
}
.benefitsList {
width: 422px;
float: left;
margin-top: 0;
}
.cameraDiv {
width: 354px;
float: left;
margin-top: 3px;
}
.heading {
margin-left: 25px;
width: 430px;
height: 40px;
background: #eceeef;
vertical-align: middle;
}
.heading #listHeading{
margin-top: 4px;
padding-top: 12px;
background: #eceeef;
font-size: 16px;
font-weight: bold;
vertical-align: middle;
}
.ulBenefits li{
margin-bottom: 7px;
border-bottom: 1px solid #eceeef;
font-size: 12px;
font-family: Arial, sans-serif;
list-style-type: disc;
padding: 0;
}
.ulBenefits li p{
margin: 5px 0;
padding: 0;
}
#headingTwo {
margin-top: 30px;
}
#secondaryText {
margin-bottom: 25px;
width: 714px;
}
.diagrams{
margin-bottom: 15px;
min-height: 50px;
width: 713px;
height: 195px;
}
.infoBox{
border: 1px solid #eceeef;
border-top: 10px solid #eceeef;
width: 211px;
display: block;
margin-left: 35px;
margin-top: 15px;
float: left;
}
.infoBox p {
margin-left: 6px;
margin-right: 6px;
}
#walkieTalkieOne {
width: 209px;
height: 186;
}
#walkieTalkieTwo {
width: 210px;
height: 186;
}
#walkieTalkieThree {
width: 211px;
height: 186;
}
.infoHeader {
font-weight: bold;
font-size: 18px;
}
.infoDesc{
margin-bottom: 15px;
}
.closer {
display: block;
margin-top: 50px;
clear: both;
position: relative;
top: 25px;
}
#resellerButton {
margin-bottom: 50px;
clear: both;
position: relative;
top: 25px;
}
#resellButtLink{
text-decoration: none;
clear: both;
position: relative;
top: 25px;
}
</style>
<div class="landingWrapper">
<div class="blockIt">
<img id="hero" alt="Your CAMCORDER. DIGITAL Sound. AFFORDABLE price." src="images/hero.jpg">
</div>
<div class="blockIt">
<img id="headingOne" alt="Sony’s new UWP-D Series wireless mics deliver high-quality sound with digital audio processing." src="images/headerOne.jpg">
</div>
<div id="introText" class="margins">
<p class="margins">Now you can get the digital sound quality you want at an affordable price. With more than 50 years of microphone innovation, Sony introduces the new UWP-D wireless microphone system. Just because your project is budget-driven doesn't mean you have to compromise on sound quality.</p>
<p class="margins">Sony's new wireless mics are the ideal audio-for-video solution that will boost the performance of even entry-level camcorders. Choose from among three packages, any of which are well-suited for ENG and field production or any budget-conscious application requiring high-quality digital audio.</p>
</div>
<div class="clearIt blockIt listWrap benefitsList">
<div class="heading">
<p id="listHeading" class="margins">Key Benefits:</p>
</div>
<ul class="ulBenefits">
<li><p>Wide range with up to 72 channels</p></li>
<li><p>Three separate UHF frequency blocks available</p></li>
<li><p>USB Portable Charger w/Lithium-Ion Battery and AC adapter</p></li>
<li><p>Sturdy metal body construction</li>
<li><p>Digital audio processing</li>
<li><p>A DSP compander provides superb transient response performance</p></li>
<li><p>Wide switching RF bandwidth with 3 UHF frequency blocks available</p></li>
<li><p>True diversity receiver for stable reception</p></li>
<li><p>Output audio gain control on receiver</p></li>
<li><p>Headphone output on receiver</p></li>
<li><p>Handheld TX includes interchangeable capsule design</p></li>
<li><p>Mic or line input on both body-pack and plug-on transmitters</p></li>
<li><p>Sony UWP/800 Series & Legacy Analog Wireless System compatibility</p></li>
</ul>
<div class="blockIt cameraDiv">
<img id="camera" alt="Camera" src="images/camera.jpg">
</div>
</div>
<div class="clearIt blockIt">
<img id="headingTwo" alt="Digital Sound Innovation for Analog Systems" src="images/headerTwo.jpg">
</div>
<div id="secondaryText" class="blockIt">
<p class="margins">Sony knows that exceptional sound quality is the most important issue in wireless transmission. While conventional analog systems use companders to provide dynamic range, the sound quality and transient response performance are not without flaws.</p>
<p class="margins">That's why Sony has developed a digitally processed sound solution that uses DSP (digital signal processing). The UWP-D Series utilizes a DSP compander that achieves high quality digital sound, all at an affordable price. DSP optimizes the audio signal processing between the transmitter and receiver, providing superb transient response performance.</p>
<p class="margins">With easy-to-use automatic channel setting mode, clear channel and active channel scan, IR sync and unprecedented frequency coverage, you will never look at sound the same way again.</p>
</div>
<div class="blockIt">
<img class="margins diagrams" id="diagramOne" src="images/diagramOne.jpg">
</div>
<div class="blockIt">
<img class="margins diagrams" id="diagramTwo" src="images/diagramTwo.jpg">
</div>
<div class="infoBox">
<img id="walkieTalkieOne" alt="UWP-D11" src="images/walkieOne.jpg">
<p class="infoHeader">UWP-D11</p>
<p class="infoDesc">Is well suited for a wide range of applications, from news gathering and interviews to talk shows and conferences.</p>
</div>
<div class="infoBox">
<img id="walkieTalkieTwo" alt="UWP-D12" src="images/walkieTwo.jpg">
<p class="infoHeader">UWP-D12</p>
<p class="infoDesc">Is widely used for interviews and news gathering and features a newly designed handheld transmitter.</p>
</div>
<div class="infoBox">
<img id="walkieTalkieThree" alt="UWP-D16" src="images/walkieThree.jpg">
<p class="infoHeader">UWP-D16</p>
<p class="infoDesc">Is ideal for interviews and news gathering and features UTX-P03 plug-on bodypack transmitter.</p>
</div>
<p class="closer margins">Contact your Sony authorized reseller today and and discover the high-quality sound of digital audio processing.</p>
<a id="resellButtLink" href="http://pro.sony.com/bbsc/ssr/product-UWPD11/42"><img id="resellerButton" class="margins" alt="Find a Reseller" src="images/button.jpg"></a>
</div>
If the browsers are rendering just fine maybe it is because they know you don't have to close a <p> or something like this, and your text editor does not know it.. Try closing everything or changing the doctype inside your editor configuration.
Firefox has a good feature when viewing the code, it paints problematic tags in red.
Also, you have two class declaration at <div class="introText" class="margins">
<div id="blockIt secondaryText"> on line 204
I think it should have been
<div class="blockIt" id="secondaryText">
Also, line 174
<div class="introText" class="margins">
should be
<div class="introText margins">
Not closed <p> tags on lines 186&187
You aren't posting your encoding. If you're using strict html encoding you have to close your img tags also [ex: <img src="" alt="" />]. I've seen in your update that you closed all the p tags. Maybe this is all that's left to do.
I am new to coding HTML/CSS but I have a pretty good grasp so far. I have spent the last few hours trying to get my code side by side but it always remains stacked. My code is
<div class="api" style="float:left;">
<a href="https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro" target="_blank">
<img src="http://developer.android.com/images/brand/en_generic_rgb_wo_60.png" style="width:50%; border:0" alt="Download ROM Toolbox Pro from Google Play" title="Download ROM Toolbox Pro from Google Play">
</a>
<div>
<div class='appbrain-app'>
<a href='http://www.appbrain.com/app/com.jrummy.liberty.toolboxpro' style='font-size: 11px; color: #555; font-family: Arial, sans-serif;'>
</a>
<script type='text/javascript' language='javascript' src='http://www.appbrain.com/api/api.nocache.js'></script>
</div>
</div>
</div>
And my CSS is,
.api {
margin: 0 auto;
margin-top: 1em;
max-width: 700px;
padding: 1em;
background-color: #e2e2e2;
border: 1px solid #C9C9C9;
box-shadow: 0 0 2px #C9C9C9;
-moz-box-shadow: 0 0 2px #C9C9C9;
-webkit-box-shadow: 0 0 2px #C9C9C9;
border-radius: 3px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
display: inline-block;
}
If you tell me what I am missing in order to get the info displayed side by side I would greatly appreciate it. If you have any other code cleanups that you can point out that would be great also but not needed.
EDIT:
Thank you for all your help guys, I have tried both Watson and Pete's answers but sadly they are not working. I took some screenshots of what it is without your code and with your code. You can find them here, https://dl.dropbox.com/u/11217802/sidebyside.png
I have also been able to get it working but I am trying to avoid as much inline styling as possible and I believe that I have pointless tags and way too many <div> for this small project.
<div class="api">
<div>
<td style="vertical-align: middle; text-align: center; background: #e2e2e2; border-top: 0px; ">
<a rel="nofollow" href="https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro" class="no_ul external" target="_blank">
<img src="http://developer.android.com/images/brand/en_generic_rgb_wo_60.png" style="width:100%; border:0" alt="Download ROM Toolbox Pro from Google Play" title="Download ROM Toolbox Pro from Google Play">
</a>
</td>
</div>
<div style="float: left;">
<div class="appbrain-app">
<a href='http://www.appbrain.com/app/com.jrummy.liberty.toolboxpro' style='font-size: 11px; color: #555; font-family: Arial, sans-serif;'>
</a>
</div>
<script type='text/javascript' language='javascript' src='http://www.appbrain.com/api/api.nocache.js'></script>
</div>
</div>
As far as the CSS, that did not change from what I posted orginally.
Thanks again Grady
try this:
.api a, .api div, .api img {
float: left;
}
and a tip: you should indent your code, so the child nodes are inside the parent nodes, like:
<div>
<a>Example</a>
<img>
<div>
<a>Example</a>
</div>
</div>
sibling nodes (when one tag is not inside another) should be indented the same amount.
looking at your code you have only floated the containing div, all the divs inside it are still block elements, if you want these to be side by side, you can do one of the following:
change them to inline elements .api div {display:inline;}
change them to inline-block elements .api div {display:inline-block;}
float them left .api div {float:left;}
EDIT
Having looked at your edit and tried your code in jsfiddle, the problem is the javascript is creating a lot of extra divs. I have changed your code layout to get things side by side:
http://jsfiddle.net/xFu4Z/1/
html
<div class="api">
<img src="http://developer.android.com/images/brand/en_generic_rgb_wo_60.png" style="width:50%; border:0" alt="Download ROM Toolbox Pro from Google Play" title="Download ROM Toolbox Pro from Google Play" />
</div>
<div class='appbrain-app'>
<a href='http://www.appbrain.com/app/com.jrummy.liberty.toolboxpro' style='font-size: 11px; color: #555; font-family: Arial, sans-serif;'></a>
<script type='text/javascript' language='javascript' src='http://www.appbrain.com/api/api.nocache.js'></script>
</div>
CSS
.api,
.appbrain-app {float:left;}
Please note that you will need to make sure the widths of .api and .appbrain-app added together don't exceed the width of the container they are in - I just noticed that on your original styles you have set a max-width of 700px which means that it is probably going to push the .appbrain-app div down a line
I restructured your markup:
<style>.api {
margin: 0 auto;
margin-top: 1em;
max-width: 700px;
min-width: 300px;
padding: 1em;
background-color: #e2e2e2;
border: 1px solid #C9C9C9;
box-shadow: 0 0 2px #C9C9C9;
-moz-box-shadow: 0 0 2px #C9C9C9;
-webkit-box-shadow: 0 0 2px #C9C9C9;
border-radius: 3px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
display: inline-block;
}
.appbrain-app { float: right; width: 48%; border: 1px solid red; }
</style>
<div class="api" style="float:left;">
<div>
<a href="https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro" target="_blank">
<img src="http://developer.android.com/images/brand/en_generic_rgb_wo_60.png" style="width:50%; border:0" alt="Download ROM Toolbox Pro from Google Play" title="Download ROM Toolbox Pro from Google Play">
</a>
<div class='appbrain-app'>
<a href='http://www.appbrain.com/app/com.jrummy.liberty.toolboxpro' style='font-size: 11px; color: #555; font-family: Arial, sans-serif;'>
</a>
<script type='text/javascript' language='javascript' src='http://www.appbrain.com/api/api.nocache.js'></script>
</div>
</div>
</div>
I have a margin used to space some headings down away from an image, but despite this method working on other pages, it does not in this instance.
I know there are plenty of alternative solutions, but am curious as to what is wrong with this one. Can anyone help?
<div class="column" style="width: 237px">
<img src="img.jpg" alt="" title="img" width="237" height="300" class="alignnone size-full wp-image-84" />
<h1 style="margin-top: 40px">VAL</h1>
<span class="detailhead">Heading 1</span> <span class="detail">Detail 1</span><br />
<span class="detailhead">Heading 2</span> <span class="detail">Detail 2</span>
</div>
These are all the additional class declarations:
The image class has no associated style (class was inserted by Wordpress).
h1 {
font-size: 17px;
}
span.detailhead{
font-size: 13px;
color:#000000;
}
span.detail {
position: relative;
top: 1.5px;
font-size: 14px;
color:#000000;
}
.column {
display: block;
float: left;
}
Here is the offending style i overlooked:
img {
display: block;
float:left;
margin-right:10px;
margin-bottom:10px;
border-style: solid;
border-width: 1px;
border-color: #ffffff;
z-index: 2;
}
A more specific selector fixed the issue.
Thanks to all for helping me with this seriously schoolboy error!
Could you try adding a style="display:block" to the img tag?
If your using chrome or safari for testing: use the element inspector to check wether your inline setting is not overruled by an !important; declaration in one of the classes.
Edit: To quickly test this you can also add " !important;" to your inline css.