Web Design Forums

Welcome! Please register or log in: Forgot your password? Why register?
You are here: Web Design Forums » Web Design Help » HTML and CSS Help » distance between two lines of text RSS

distance between two lines of text

This thread was started by ketanco and has been viewed 911 times, and contains 4 replies, with the last reply made by Dorky.
Post Reply
1
View ketanco's reputation
ketanco, Must... Post... More...! Private message   E-mail
Posted June 5 '09 at 09:49 PM
      Posts: 228
hello,
I have two
</br>
</br>
but i dont lke the spacing betwene two lines of text under each other. Th espace between two lines is too much. How can I reduce the space between two lines of text? I tried <p> but it is even worse, more space...I am trying to reduce spacing between two lines of text...more than one </br> but less than two </br>
such as:
line of text 1
line of text 2
so, how can I adjust the spacing between these two lines precisely as I like?

Advertisement Register for free to hide these ads and participate in discussions!

2
328 points at 98% Repute
Posted June 6 '09 at 12:48 AM
      Posts: 721
Use line-height in your css.
Steve,
Man I hate being dumb!
Aero Web Design

3
76 points at 100%
jyuill, WDF Addict! Home page   Private message   E-mail
Posted June 6 '09 at 11:03 AM
      Posts: 145
hello,
I have two
</br>
</br>
but i dont lke the spacing betwene two lines of text under each other. Th espace between two lines is too much. How can I reduce the space between two lines of text? I tried <p> but it is even worse, more space...I am trying to reduce spacing between two lines of text...more than one </br> but less than two </br>
such as:
line of text 1
line of text 2
so, how can I adjust the spacing between these two lines precisely as I like?

If the two lines are in fact paragraphs, then use the <p> tag. If the space is too much (and this is something most people probably do anyay), set the margin and padding to 0 in your css. Some do it in the body{} declaration, I use the *selector at the start of my CSS. That also helps your page start off appearing the same in all browsers, along with making it so you can position everything exactly how you want it.
Many people use massive resets; I have found the margin:0; padding:0; works just fine for me.
Then you will want to set your line-height to get just the space you want.
Semantic, Valid, and Accessible Design!

Last edited June 6 '09 at 11:04 AM by jyuill ("added more info."). Reply

4
9 points at 100%
Posted June 11 '09 at 10:36 AM
      Posts: 45
Yes, altering the line-height in the css code should solver this problem.

I try to avoid using <p> because it disrupts the background of the container div.

5
34 points at 74%
Dorky, Freelance Home page   Private message  
Posted June 11 '09 at 11:55 AM
      Posts: 786
<p> is just fine lol.

p { margin: 0px; }
“Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.” Albert Einstein

Post Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
New line of text on same line, old lines move upward? slyder HTML and CSS Help 3 August 5 '07 02:21 PM
shortening a vertical border sanchopansa HTML and CSS Help 2 September 26 '06 09:15 AM
vBMS for 3.5.0 updates filburt1 Questions Before I Buy 21 January 25 '06 09:46 PM
Can a single "table shell" (no TDs) be used without the disadvantages of tables? krystof HTML and CSS Help 18 September 6 '05 01:37 PM
Positioning Problems JR HTML and CSS Help 12 February 28 '04 02:10 PM