Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I insert vertical blank space into an html document?

I am writing a quiz in HTML and I would like to insert a consistent blank vertical space between questions (like one would use vspace{3 cm} in LaTeX).

For example:

<html>
  <body>
    <p>
     This is the first question?
      <!-- This is where I want about 3 cm of space -->
    </p>
    <p>
     This is the second question?
     <!-- This is where I want about 3 cm of space -->
    </p>
  </body>
</html>

Is there a straightforward way of doing this using just HTML and CSS?

How can I insert vertical blank space into an HTML document?

like image 974
DQdlM Avatar asked Feb 04 '12 12:02

DQdlM


People also ask

How do I leave a blank space in HTML?

HTML Non-Breaking Space (&nbsp;) The simplest way to add a space in HTML (besides hitting the spacebar) is with the non-breaking space entity, written as &nbsp; or &#160;.


3 Answers

Read up some on CSS. It's fun: CSS: em, px, pt, cm, in…

<style>
  .bottom-three {
     margin-bottom: 3cm;
  }
</style>


<p class="bottom-three">
   This is the first question?
</p>
<p class="bottom-three">
   This is the second question?
</p>
like image 102
DMCS Avatar answered Oct 19 '22 22:10

DMCS


While the previous answers are probably best for this situation, if you just want to do a one-off and don't want to bother with modifying other files, you can in-line the CSS.

<p style="margin-bottom:3cm;">This is the first question?</p>
like image 23
SMBiggs Avatar answered Oct 19 '22 22:10

SMBiggs


I always use this cheap word for vertical spaces.

    <p>Q1</p>
    <br>
    <p>Q2</p>
like image 16
narendra singh Avatar answered Oct 19 '22 21:10

narendra singh