Margin, padding, or whatever?
If your lines stored in single <div>
or <p>
element, your can use(as was mentioned above) line-height
(line-height) attribute.
In case, when lines are placed in different block elements, yuo can modify space between two lines with margin
(margin description) or padding
(padding description) attributes.
Margin is used to specify the distance between elements.
Padding is used to specify the padding between an element and it's content.
Line-height is used to specify the height of text lines in a continuous text.
So, if you have separate elements that you want a distance between, margin is appropriate:
<p style="margin: 5px 0">Line 1</p>
<p style="margin: 5px 0">Line 2</p>
If you have a continuous text where you want a distance between the text lines, line-height is appropriate:
<p style="line-height: 1.8em">Long text that spans several lines...</p>
Great answer. Short Sweet and to the point. Thanks for the easy clarification.