The following CSS will create space between lines:
p{
line-height: 2.7;
}
You can use any numbers to specify the line-height
depending on your font. But normally we use “1.7”
You can also specify the line-height
with “px, em, cm, %” etc. For example:
p{
line-height: 30px;
}
p{
line-height: 2em;
}
Create Space Between Paragraphs
You have to use the margin
property to create space between paragraphs. See the following example:
p{
margin-bottom: 60px;
}
This code will create the bottom margin of the paragraphs by 60 pixels. If you need to create space both at the top & bottom of the paragraphs, then use the following CSS:
p{
margin: 60px 0;
}
This code will create a 60 pixels margin both at the top & bottom of the paragraphs.
Learn & practice CSS with real-world examples |
---|
Learn basic CSS from the ground up. |
Build real projects in HTML CSS. |