html - 如何制作窗口高度为 100% 的部分

标签 html css

我将我的页面分成多个部分标签,这就像网站有多个页面一样。我的问题是我无法让每个部分都具有 100% 的窗口高度,并且不知何故部分之间存在间隙

我希望我可以在没有任何 JavaScript 和使用百分比的情况下解决这个问题,这样它会更流畅。

下面是我页面的 HTML 大致样子:

<div id="nav">
  navigation code here
</div>

<div id="wrapper">
  <section>content</section>
  <section>content</section>
  <section>content</section>
</div>

完整的 HTML 和样式可以在 http://theailona.com/doaibu 找到。

编辑:Gopikrishna 和 Praveen Kumar 解决了差距

最佳答案

CSS 修复:

这是因为 margin<h1>标签。在您的 CSS 中更新它。还有,margin<p>标签给你空白。

h1 {margin: 0;}
.content {overflow: hidden;}

备选方案:

#wrapper > section {overflow: hidden;}

关于html - 如何制作窗口高度为 100% 的部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13598422/

相关文章:

html - 我的 Bootstrap 代码有什么问题?

Javascript 检查 <p> 是否存在于 <div> 中

jquery - 图像映射 : show alternate image of areas on mouseover

javascript - 更改 jqGrid 的样式

css - 移动 View HTML 中的重叠 div

javascript - 如何像媒体查询一样在断点处禁用 JavaScript

html - Bootstrap 表 : Grid system - How to put image with width in different rows and the same column

html - Box Shadow 在输入焦点上工作不正确

html - CSS 文本对齐 : center ignored even with ! 重要指定

php - 根据URL更改内容