CSS3 background-size - can I guarantee coverage?

孤人 提交于 2019-12-04 11:01:22

I haven't implemented a css-only way to do this, but I did use the backstretch jQuery plugin once, and it worked across the board. http://srobbin.com/blog/easy-full-screen-background-images-with-jquery/

Just set the height or min-height of the html:

html {
  min-height: 100%;
}
body {
    background-image: url(http://i.imgur.com/igLMC.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-color: red
}
<!DOCTYPE html>
<html>
<head>
</head>
<body>

</body>
</html>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!