html background color issue - html

I have a background color of #efefef (greyish), color loads just fine in every browser.
Problem is that when I copy the whole file from the browser and paste it in an e-mail, then the background color changes to white.
How do I keep it the same color?
<body bgcolor="#efefef" link="#ff6633" alink="#ff6633" vlink="#ff6633">

Try
<div style="background-color:#EFEFEF">
<p>EMAIL TEXT</p>
</div>
in your email.

You can not use <body> tags in html email. All email clients will strip out any <body> <head> tags etc.
You need to rebuild the email using tables and use inline styles to style the elements.
HTML emails are notoriously difficult to code. The way you are trying to do it simply will not work i'm afraid.
Here is a brief introduction to coding html email: http://www.sitepoint.com/code-html-email-newsletters/

Related

I have two mailto links in my email template and would like to have two different colors on it.(Blue & White)

a[href^="mailto:"]
{
color: blue;
}
I am using the above code and it's getting applied to both mailto links. Is there any way that we can have two different colors for mailto link? tried SPAN class but not working in Outlook.
try like this
HTML
<body>
232322232
232322232
</body>
css
body{
background-color:#000;
}
a.blue{
color:blue;
}
a.white{
color:white;
}
The recommended way is to have the styles in-lined. This way you are sure that your link colours will work the same across every email clients.
Note: Some answers on this question are either using jquery or CSS in the head. jQuery doesn't work in emails and some email clients strip off <head> ... </head> from your document.
<div style="background-color:#000000;padding:20px 10px;">
Send Mail 1
Send Mail 2
</div>
By default all links are blue. If you wish to change it to a different shade of blue you can use the code similar to the second link.

Can't change background colour in Dreamweaver

I'm creating a newsletter email in Dreamweaver, I'm almost done but I can't change the background(or body I suppose). I tried entering using the color picker tool, but nothing changed, it's still the same color as before.
p.s I can't show the code, whenever I try to post it, I get a red box saying that it appears to contain code that is not properly formatted as code, so I'll just send a screenshot of the code.
https://i.gyazo.com/558639f136aa691c08b947dc2b9fc3da.png
If you wish to change a color of background use one method. Because in your code you messed up. You have used both inline and internal stlying.Since I didn't see your all codes I give you 2 solutions.
HTML code
<body>
<table <!-- your table properties goes here--> >
</table>
</body>
CSS code
body{
background-color: #0aed05; /* Green*/
}
Or even it won't work.Check it out this one.
HTML code
<body id="body">
<table <!-- your table properties goes here--> >
</table>
</body>
CSS code
#body{
background-color: #0aed05; /* Green*/
}

Different Body background image use html css

i use body background image different page different background image
Example
<body class="home">
<body class="contact">
but w3 validator error:
"Start tag body seen but an element of the same type was already open." , "Cannot recover after last error. Any further errors will be ignored."
i can use with Jquery
<script>
$('body').addClass("home");
</script>
<script>
$('body').addClass("contact");
</script>
But i want use Html Css no Jquery please help me
All right, you open one element body and then want to open another. One html page must contain one body element. It's a standart.
You are wanting a different background image for EACH page home.html, and contact.html.
home should look like this.
<body class="home">
contact
<body class="contact">
then put the appropriate css with each for different backgrounds

Issue in my HTML/CSS email

I know that when i come to HTML email i have to use the Table Layouts. This is what i have done here Unfortunately when i make some tests with this online tool to my Hotmail and gmail, the layout is not exactly the same. In the email the difference from my HTML code is that it does not get the same H2 font style and family in the text <h2>"Responda correctamente a las preguntas y gane un viaje a Roma!"</h2> and the second image is separated from the one on the top and the one on the bottom. What's the best solution to figure it out the issue? How can i achieve the same layout?
Thanks for your time
Do not rely on external (<link rel="stylesheet">) or embedded style sheets (those contained within the <style> tag above the <body> tag). This is the most important thing to avoid. Many email services cut everything above the body tag and disable external style sheets. That said you can include a few embedded CSS statements (such as link color) as long as you're ok with them not rendering in some email clients.
Taste this post: http://groundwire.org/labs/email-publishing/using-css-and-html-in-email-newsletters
Try to add style="display:block;" to all your img tags and instead of an h2 use a font tag with a style attribute:
<font style="color:#202020; font-family: 'Georgia',serif; font-size: 14px; line-height: 20px;">
<b>Some title</b>
</font>
<br>

Setting css properties on HTML email

I'm sending an automatic html email from my website. In my email I set some text to red color and the font to a certain font type. When I view the html email from yahoo mail, The red color is applied, but the font is not applied. Why is it?
Also, when I try to view the html source code of the yahoo mail web page, I cannot find my html email content on this html source code. why is it?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<h2 style="color: #CC0000; text-align: center;">
Welcome to the Dave's Photo Album</h2>
<p>
Hi <%UserName%>,</p>
<p>
Thanks for registering. Here is your new user name and password:</p>
<p>
User Name: <%UserName%>
</p>
<p>
Password: <%Password%>
</p>
<p>
Enjoy!
</p>
You can use css inline only, and from my experience you need to do it with tables, since not all email services (none maybe) understand divs that well, I also recommend to stay within 600 px wide for the template, since its usually displayed in "panes" like yahoo mail, gmail, outlook etc. there's a lot of material you can check over at this page:
http://www.campaignmonitor.com/css/
there's no html, body or title declaration, just start with <table></table> like if was your body.
outlook 2007 will probably be the one with the most restraints.
good luck
In css, you can use font or font-family to change the font. I don't see anything that would actually change the font in your code there!
http://www.w3schools.com/css/css_font.asp
Don't send email in HTML. It is much more likely to be flagged as spam if you do.