TopChef
TopChef

Reputation: 45503

Question about text in HTML/CSS

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.

Upvotes: 1

Views: 85

Answers (5)

Stuart.Sklinar
Stuart.Sklinar

Reputation: 3761

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>

Upvotes: 2

DipakRiswadkar
DipakRiswadkar

Reputation: 302

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.

Upvotes: 0

Zack Marrapese
Zack Marrapese

Reputation: 12091

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.

Upvotes: 0

Ryan
Ryan

Reputation: 28227

You could do

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

Upvotes: 1

Quentin
Quentin

Reputation: 944196

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.

Upvotes: 7

Related Questions