【问题标题】:div not expanding to full height of background imagediv没有扩展到背景图像的全高
【发布时间】:2013-12-11 10:23:47
【问题描述】:

我正在使用引导程序并希望全宽 div 在背景图像上达到 100% 的高度。我无法弄清楚为什么它会折叠到仅行高。有任何想法吗?见小提琴:

http://jsfiddle.net/aartese/3kRVm/

 <body>   
  <row><!--landing section -->
     <div class="col-md-12 landing">Landing</div>
  </row> <!-- /landing section -->
  <row><!--about section -->
    <div class="col-md-12 about">About</div>
  </row><!-- /about section -->
  <row><!-- professional profile section -->
    <div class="col-md-12 professional">Professional</div>
  </row><!-- /professional profile section -->
  <row> <!-- contact section -->
    <div class="col-md-12 contact">Contact</div>
  </row> <!-- /contact section -->    
 </body>

【问题讨论】:

  • 背景图片不能影响作为背景的元素的尺寸。还,。没有像 row 这样的 HTML 元素。
  • 您想将哪个div 拉伸到100%?您必须在 htmlbody 上设置 height: 100%; 才能让 div 占据页面:jsfiddle.net/3kRVm/1
  • 哎呀,应该是

标签: html css twitter-bootstrap


【解决方案1】:

that 是你的意思吗?基本概念复制自 Ryan Fait 的 sticky footer。它基本上围绕确保所有父元素的min-heightheight 是100%

【讨论】:

    猜你喜欢
    • 2021-01-16
    • 1970-01-01
    • 2019-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-16
    • 1970-01-01
    相关资源
    最近更新 更多