背景图像垂直重复为div [英] background image vertical repeat for a div

查看:124
本文介绍了背景图像垂直重复为div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想垂直重复背景图片,直到页面底部。

I want to repeat a background-image for a div vertically till the bottom of the page.

#repeat {
   background: url(repeat-image.png) repeat-y;
   height: 100%; /* this does not work, but height: 1024px; does */
}

这不起作用。我需要这样做根据我得到的页面设计。可以这样做吗?

This does not work. I need to do so according to the page design that I have got. Can this be done?

关于
Vikram

With regards Vikram

推荐答案

尝试为您的< body> 设置 height:100%。如果您的网页上除了此div之外没有任何内容,则100%高度将为0px,而不使用这些设置。

try to set height:100% for your <body> and <html>, too. if there is nothing except this div on your page, 100% height will be 0px without these settings.

这篇关于背景图像垂直重复为div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆