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
Solved

Double Space with <br>

Posted on 2013-02-07
4
212 Views
Last Modified: 2013-02-17
Hi,

When using a <br> it makes 2 spaces between lines:

			<span style="font-size: 12px"><font face=""><font face="Arial, Helvetica, sans-serif"><strong><span style="font-size: medium;"><span style="color: #cc0000;">John</span></span></strong> </font></font><span style="font-family: arial, helvetica, sans-serif"><strong><span style="font-size: medium;"><span style="color: #808080;">Doe</span></span></strong></span><font face=""><font face="Arial, Helvetica, sans-serif"><span style="font-family: arial, helvetica, sans-serif"><br />
			</span></font></font><span style="font-family: arial, helvetica, sans-serif"><span style="font-size: xx-small;"><em>Title 1</em></span></span><font face=""><font face="Arial, Helvetica, sans-serif"><span style="font-family: arial, helvetica, sans-serif"><span style="font-size: xx-small;"><span style="color: #cc0000;">?</span> </span></span></font></font><span style="font-family: arial, helvetica, sans-serif"><span style="font-size: xx-small;"><em>Title 2</em></span></span><font face=""><font face="Arial, Helvetica, sans-serif"><span style="font-family: arial, helvetica, sans-serif"><span style="font-size: xx-small;"> <span style="color: #cc0000;">?</span> </span></span></font></font><span style="font-family: arial, helvetica, sans-serif"><span style="font-size: xx-small;"><em>Title 3</em></span></span>

Open in new window

double-space.jpg
0
Comment
Question by:Computer Guy
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 38863473
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 38863475
here's the solution from the link posted above:


Css:

br {
   display: block;
   margin: 10px 0;
}
The solution is probably not cross-browser compatible, but it's something at least. Also consider setting line-height:

line-height:22px;
For Google Chrome, consider setting content:

content: " ";
Other than that, I think you're stuck with a JavaScript solution.
0
 
LVL 27

Expert Comment

by:yodercm
ID: 38863502
I believe you are missing an end span in the first line, and the system is putting one in at the end, causing the extra line.
0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 38863553
Wow. That is probably the worst HTML that I've seen for a long, long time. Is there a particular reason for it? Have a look at the following. It does the same thing, only properly:

<div class="person">
	<h2><em>John</em> Doe</h2>
	<p>Title 1 <em>?</em> Title 2 <em>?</em> Title 3</p>
</div>

<style type="text/css" media="screen">
	.person { font-size:12px; font-family: arial, helvetica, sans-serif; }
	.person h2 { margin:0px; color: #808080; font-size:medium; }
	.person p {  margin:0px; font-size: xx-small; font-style:italic; }
	.person em { color: #cc0000; font-style:normal; }
</style>

Open in new window

Adjust the space between the lines by either adding a top margin to the P or a bottom margin to the H2.

FYI: The font tag is deprecated.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: blockā€¦
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

861 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