简体   繁体   English

背景重复:repeat-y; 不工作

[英]background-repeat: repeat-y; not working

I'm quite new to CSS and for sure I'm missing something basic here but I really can't figure it out. 我对CSS还是很陌生,可以肯定的是,这里我缺少基本的东西,但是我真的不知道。 This is the code: 这是代码:

In HTML I have this: 在HTML中,我有这个:

<div class="tab-left"></div>

In CSS: 在CSS中:

.tab-left {
    background-image: url(images/left.png);
    background-repeat: repeat-y;
    position: absolute;
    width: 96px;
    height: 1049px;
    margin-left: -40px;
    z-index: 99999;
    }

However, the repeat-y property does not work. 但是,repeat-y属性不起作用。 This is the site in question: http://ziontouch.com/wordpress/ 这是有问题的网站:http: //ziontouch.com/wordpress/

What am I doing wrong? 我究竟做错了什么?

Your repeat is working fine. 您的重复效果很好。 The problem is that the height isn't tall enough to reach the bottom edge of the page. 问题在于height不够高,无法到达页面的底部边缘。

The background is repeating. 背景重复的。

The problem is that the .tab-left has an explicit height set, which isn't as tall as you are expecting. 问题在于.tab-left设置了一个明确的height ,该高度不如您期望的那么高。

可以工作,但是您的DIV元素的高度不足以填满整个空间...

重复,直到您的height属性指定的最大1049px。

You should use a bigger height. 您应该使用更大的高度。

.tab-left {
    height: 1622px;
}

That reaches exactly the beginning of the border bottom. 恰好到达边界底部的起点。

just replace with the following code: 只需替换为以下代码:

.tab-left {
   background-image: url(images/left.png);
   background-repeat: repeat-y;
   position: absolute;
   width: 96px;
   height: 1610px;
   margin-left: -40px;
   z-index: 99999;
}

EDIT right tab is the same EDIT右选项卡相同

.tab-right {
   background-image: url(images/right.png);
   position: absolute;
   width: 96px;
   height: 1610px;
   margin-left: 864px;
   z-index: 99999;
}

I see that you're using jQuery in your page so what you can do is use jQuery to find the height of your div#page and use that value to set the heights of your tab-left and tab-right classes. 我看到您在页面中使用jQuery,因此您可以使用jQuery查找div#page的高度,并使用该值设置左向左和向右向右类的高度。

Like this: 像这样:

$('div.tab-left').css('height',$('div#page').height());

$('div.tab-right').css('height',$('div#page').height());

Then as content is added to your page, it will adjust as necessary. 然后,当内容添加到您的页面时,它将根据需要进行调整。

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

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