简体   繁体   English

背景图像与重复-y不覆盖整个高度

[英]background-image with repeat-y doesnt cover the full height

I have the following HTML: A sidebar with a color full height an left side outside of the page of a color, so i have an image to cover the left side of the page and goes to the full height, but in chrome it doesnt cover the full height of the page with repeat-y; 我有以下HTML:一个颜色全高的侧边栏,一个颜色的页面左侧,所以我有一个图像覆盖页面的左侧,并达到完整的高度,但在铬它不覆盖带有repeat-y的页面的完整高度;

my css: (doesnt work in chrome) 我的css :(在chrome中不起作用)

body {
    background: #000 url(../images/bar_bg.jpg) repeat-y;
}

#container {
    height: 100%;
}

I want to achieve this: 我想实现这个目标: 在此输入图像描述

Is there is another way to do it without images or with CSS3 maybe? 有没有其他方法可以在没有图像或CSS3的情况下做到这一点?

Your html and body are not covering the entire viewport, use... 您的html和正文未覆盖整个视口,请使用...

html, body {
  height: 100%;
}

我不得不对代码做一些工作,但这听起来像margin-height需要设置为零。

solved with 解决了

html, body{
min-height:100%;
height:auto;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM