首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在html文档中插入垂直空格?

如何在html文档中插入垂直空格?
EN

Stack Overflow用户
提问于 2012-02-04 20:49:11
回答 4查看 173.2K关注 0票数 46

我正在用html写测验,我想在问题之间插入一致的垂直空格(就像在LaTeX中使用vspace{3 cm}一样)。

例如:

代码语言:javascript
复制
<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>

有没有一种只使用htmlcss就能做到这一点的直接方法

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2012-02-04 21:04:03

读一些关于css的文章,它很有趣:http://www.w3.org/Style/Examples/007/units.en.html

代码语言:javascript
复制
<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>
票数 52
EN

Stack Overflow用户

发布于 2018-02-20 06:00:22

虽然上面的答案对于这种情况可能是最好的,但如果你只想做一次,而不想麻烦地修改其他文件,你可以内联CSS。

代码语言:javascript
复制
<p style="margin-bottom:3cm;">This is the first question?</p>
票数 20
EN

Stack Overflow用户

发布于 2019-05-21 18:44:58

我总是用这个廉价的词来表示垂直空间。

代码语言:javascript
复制
    <p>Q1</p>
    <br>
    <p>Q2</p>
票数 16
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9140999

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档