Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change size of blank line in HTML

Tags:

html

I'd like to insert a blank line in my HTML code but I'd like to change the size of this blank line to see if it fits with the rest of the page.

Does someone know how to do this ?

like image 602
Bruno Avatar asked May 24 '11 13:05

Bruno


3 Answers

The nicest way would be to put a bottom margin on the element you want some spacing after. The other solutions posted are not semantic and your markup will end up to be a giant mess of spacer elements without content.

CSS is the right way for presentation.

For example if you have two paragraphs, and want some spacing after the first one:

<p style="margin-bottom: 20px;">Blabla</p>
<p>Blabla 2</p>

This is just an illustration, your best bet would be using id / class and a separate stylesheet.

The only other semantic solution I can think of is a <HR> element, but it is a quite problematic one if you want to style it cross-browser (see details on the link).

like image 117
kapa Avatar answered Sep 29 '22 23:09

kapa


You could use something like:

<p style="height: 200px"></p>
like image 26
rid Avatar answered Sep 29 '22 22:09

rid


How about using the line-height css property?

Like this: <span style="line-height: 50px;">&nbsp;</span>

like image 35
Bas Slagter Avatar answered Sep 30 '22 00:09

Bas Slagter