码迷,mamicode.com
首页 > Web开发 > 详细

body和html背景色区别

时间:2018-06-12 19:41:57      阅读:653      评论:0      收藏:0      [点我收藏+]

标签:class   red   html   .com   repeat   jpg   code   htm   设置   

1.当body背景色设置为红色,html设置为图片时

body {
     background-color: red;
 }

html {
    height: 100%;
    background: linear-gradient(rgba(196, 102, 0, 0.2), rgba(155, 89, 182, 0.2)),
    url("../imgs/register.jpg") no-repeat 100%;
}

技术分享图片

2.当html背景色设置为红色,body设置为图片时

html {
     background-color: red;
 }

body {
    height: 100%;
    background: linear-gradient(rgba(196, 102, 0, 0.2), rgba(155, 89, 182, 0.2)),
    url("../imgs/register.jpg") no-repeat 100%;
}

技术分享图片

 

body和html背景色区别

标签:class   red   html   .com   repeat   jpg   code   htm   设置   

原文地址:https://www.cnblogs.com/ccllj/p/9174575.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!