Click to See Complete Forum and Search --> : distance between two lines of text


ketanco
06-05-2009, 08:50 PM
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?

Four Staples
06-05-2009, 08:56 PM
Use CSS. You can either use 2 <p> elements or a single <p> depending on your situation... are you wanting to set the distance between 2 lines, or the distance between 2 paragraphs?

If paragraphs:<p style="margin-bottom: ___px">This is the first paragraph.</p>
<p>This is the second.</p>
Put in a value for ___, I prefer something 10 to 15ish myself.

If you just want to set the general line spacing within a paragraph:<p style="line-spacing: 150%">This is the first line.<br>This is the second.</p>
That should add about 50% more space in between the lines, compared to the default.

coothead
06-06-2009, 02:32 AM
Hi there ketanco,

To precisely set the space between lines of text use the CSS property line-height.
I think that Four Staples was thinking of this when he/she referred to "line-spacing".

Further reading:-

http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height
http://www.w3schools.com/Css/tryit.asp?filename=trycss_line-height

coothead

Four Staples
06-06-2009, 01:34 PM
Hi there ketanco,

To precisely set the space between lines of text use the CSS property line-height.
I think that Four Staples was thinking of this when he/she referred to "line-spacing".

Further reading:-

http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height
http://www.w3schools.com/Css/tryit.asp?filename=trycss_line-height

coothead

Hmmm yeah I'm not sure where I got "line-spacing" from... it's definitely line-height.

coothead
06-06-2009, 02:58 PM
Hi there Four Staples,

You might have had your thoughts turned to letter-spacing or word-spacing at the time of posting. ;)

coothead