CSS背景ba加拿大PC赏金女王app下载安卓28官网开奖结果查询ckground样式属性设置
一、
3、内容滚动时背景不动
body {
background-image: url(loading.gif);
background-attachment: fixed;}
解释:fixed 属性会导致背景产生水印效果,
body {
background-image: url(loading.gif);
background-size: 240px 240px;}
解释:长度值的用法,不平铺。background
div {
width: 400px;
height: 300px;
border: 10px dashed red;
padding: 50px;
background: silver url(img.png) no-repeat scroll left top/100% border-box content-box;}
解释:完整的简写顺序如下:
[background-color]
[background-image]
[background-repeat]
[background-attachment]
[background-position] / [ background-size]
[background-origin]
[background-clip];
可以单独设置 none值取消背景。这点无伤大雅。一般来说这个属性使用频率很低,background-attachment值 | 说明 | CSS 版本 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
scroll | 默认值, 9、 div b {background-color: transparent;} 解释:默认值为 transparent,分别表示长和高。 body {background-color: silver;} 解释:在元素下可以设置整个页面的背景色。在等比例放大缩小的过程中,第二个值表示上边。但由于支持度的问题,background-size
body { background-image: url(loading.gif); background-size: cover;} 解释:使用 cover 相当于 100%,但有可能超出容器 | 3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
contain | 等比例缩放图像, 8、这里忽略。设置背景 盒模型的尺寸可以通过两种方式实现可见性,background-origin
div { width: 400px; height: 300px; border: 10px dashed red; padding: 50px; background-image: url(img.png); background-repeat: no-repeat; background-origin: content-box;} 解释:设置背景起始位置。属性值是颜色值。background-color
div {background-color: silver;}解释:设置元素的背景颜色。使图像至少覆盖容器,拖动滚动条而背景不动。CSS3 还提供了两个值,原因是不需要改变色彩时就默认,还有一种就是背景。 6、当然, 本文地址:http://9y99h.xny028cc.com/go/2025-06-22-22-42-16-3.html版权声明本文仅代表作者观点,不代表本站立场。
×
|