使< body>填满整个屏幕? [英] Make <body> fill entire screen?

查看:284
本文介绍了使< body>填满整个屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用径向渐变作为我网页上的背景,例如:

I'm using a radial gradient as the background on my webpage, like so:

background-image: -webkit-gradient(radial, 100% 100%, 10, 90% 90%, 600, from(#ccc), to(#000));

它可以工作,但是当内容不填满整个页面时,渐变被截断。如何使< body> 元素填充整个页面,总是?

It works, but when the content does not fill the whole page the gradient is cut off. How can I make the <body> element fill the entire page, always?

推荐答案

html, body {
    margin: 0;
    height: 100%;
}

这篇关于使&lt; body&gt;填满整个屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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