1

I know the fix to this is probably rather easy, but how would I go about getting a line of HTML to appear like this:

22 West Washngton St.
Northbrook, IL 39492

Instead of:

22 West Washington St.

Northbrook, IL 39492

Essentially, how do I go about eliminating that space between my lines of text? I am currently using <p> tags on both seperate tags. If I put them within the same <p> tag, they simply line up next to each other.

1
  • post your code for more help. Commented Jul 26, 2011 at 14:05

5 Answers 5

7

Don't use <p> for each line. They are lines of an address, not separate paragraphs. Use a line break instead (<br>). As a side effect, that will eliminate the margin that you dislike.

Sign up to request clarification or add additional context in comments.

Comments

2

There are a million and one ways to do this..

I would recommend the first solution - as it seems the 'proper' way to do it IMHO.

It sounds like you just need to use a line break () after the .st

<p>22 West Washngton St. </br>
Northbrook, IL 39492</p>

Just to add to other ways to do this - one way is. one would be to use a span tag and a break after st.

<span>22 West Washngton St. </br>
Northbrook, IL 39492</span>

Comments

1

You could do

<p>22 West Washngton St.<br />
   Northbrook, IL 39492</p>

Comments

0

The <p> tag is meant to surround paragraphs of text. If you don't want this functionality -- and you don't in this case -- simply use <br /> tag between the two lines.

Comments

0

Add the following into the head tag or your common css.

<head>
<style> 
p { margin: 0px; padding: 0px }
</style>
</head>

Use the Firebug in Mozilla Firefox to review CSS at runtime. if there are any more css conflicting particularly at your instance.

1 Comment

Should we not be guiding people to using external style sheets?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.