In this article, I will show how to set line spacing in css . You can use line-height property to the distance between lines of text in a paragraph.i.e line spacing css.
You need to specify the units of measurement for the line-height like pixels or ems. Here I have specified line height 1.5, applied to a text paragraph (space between two lines).
Line spacing in Html code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
p {
font: 17px Arial, sans-serif, Helvetica,Verdana;
line-height: 1.5;
}
</style>
</head>
<body style="border: 1px solid #e2d9d9; width: 500px; height: 340px">
<h1 style="color: #0480d1">Cssparagraph spacing </h1>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque
penatibus etmagnis dis parturient montes, nascetur ridiculus mus.
Donec quam felis,ultricies nec, pellentesque eu, pretium quis, sem.
Nulla consequat massa quisenim.
</p>
</body>
</html>
Output:
Post your comments / questions
Recent Article
- How to Encode & Decode using Base64 in Python?
- Unspecified error-The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support.
- How to generate a Captcha verification code image with Python?
- How to show an image using path python PIL?
- How to remove Background from the images using Python?
- Python generate QR code image
- Insert excel file data into MySQL database in Python
- ImportError: Missing optional dependency 'xlrd' | How tot Convert xls to xlsx | Python
Related Article