Solved

<br> tags and spacer images in HTML emails

Posted on 2011-03-25
5
194 Views
Last Modified: 2012-05-11
Hi

I just wanted to know peoples thoughts on the best way to get pixel perfect spacing between paragraphs etc in html emails.

I have experience of using br and p tags that cause inconsistencies in spacing within different email clients. So, to combat this i have been using spacer images. Some people say this is a bad idea - is this true and if so any advise how spacing should be tackled?

Cheers
0
Comment
Question by:coolispaul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35215644
why don't you use the css div combination?
0
 
LVL 12

Expert Comment

by:Amick
ID: 35216678
You can use CSS styles to precisely position each element.

If you're just looking to adjust spacing, something like
<br/><span style="line-height:___px;">&nbsp;<br/></span>

Open in new window

might help you get around the images issue.
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 35230609
Always use CSS for layout. You should never use images or <br /> for spacing. Many people have images turned off in emails, so not only is it bad practice, it would also blow your layout.

To set the spacing below paragraphs simply add a margin-bottom rule to your P tags in CSS.

p { margin-bottom: 25px; }


0
 

Author Comment

by:coolispaul
ID: 35433828
i tried this but i only seem to get success by using spacer images for all clients
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 35433943
You may need to 'reset' your CSS rules to make your styling as consistent as possible across al clients.

Have a read here - http://meyerweb.com/eric/tools/css/reset/  - and then download and link to the reset.css stylesheet.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Ajax on ASP 2 65
html5 1 42
allow link tag to be submit like form 15 58
Disabling a Faux Submit Button 4 37
This article discusses four methods for overlaying images in a container on a web page
Are you irritated by repeating emails issue in Microsoft Outlook 2016 after recent update ?  Lets’ see how to resolve and prevent duplicate emails in the Outlook 2016 using some simple techniques.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question