当前位置:网站首页>设置了body的最大宽度,但是为什么body的背景颜色还铺满整个页面?
设置了body的最大宽度,但是为什么body的背景颜色还铺满整个页面?
2022-04-23 06:25:00 【小白蛋挞】
当html标签无背景样式时,body的背景色其实不是body标签的背景色,而是整个页面的的。一旦html标签含有背景色,则body的背景色变成了正常的body标签的背景色,而此时的html标签最顶级,背景色被浏览器获取,成为整个页面的背景色。
body {
min-width: 320px;
max-width: 750px;
margin: 0 auto;
height: 2000px;
line-height: 1.5;
font-family: Arial, Helvetica;
background-color: #F2f2f2;
}
比如下图,只给body指定了背景色,所以body的背景色成为html的背景色。
当我们给html指定背景色以后,html的背景色就成为整个页面的背景色。
版权声明
本文为[小白蛋挞]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_61547956/article/details/124083093
边栏推荐
猜你喜欢
redis连接出错 ERR AUTH <password> called without any password configured for the default user.
Reflection on the systematic design of Android audio and video caching mechanism
SAP PI/PO rfc2Soap 发布rfc接口为ws示例
Nacos/sentinel网关限流和分组 (代码)
int a = 1存放在哪
AuthorizationServer(授权服务器的简单搭建)
SAP PI / Po rfc2restful Publishing RFC interface as restful examples (proxy indirect)
Authorization server (simple construction of authorization server)
keytool: command not found
SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)
随机推荐
typescript字典的使用
js之DOM学习三种创建元素的方式
ogldev-读书笔记
Dirichlet 前缀和(数论优化式子复杂度利器)
4.多表查询
js之DOM事件
[hdu6833]A Very Easy Math Problem(莫比乌斯反演)
SAP 03-AMDP CDS Table Function using ‘WITH‘ Clause(Join子查询内容)
[牛客练习赛68]牛牛的粉丝(矩阵快速幂之循环矩阵优化)
Date对象(js内置对象)
F-牛妹的苹果树(直径合并)
js之DOM学习获取元素
两个线程交互打印奇偶数字
[Ted series] how to get along with inner critics?
6. Aggregation function and grouping statistics
13.用户和权限管理
Authorization+Token+JWT
Visualization Road (IX) detailed explanation of arrow class
2. Restricted query
反思 | Android 音视频缓存机制的系统性设计