css格式盒子 、定位、布景物 、尺寸

2026-07-21 22:03:30/百科/21659 阅读

1.布景物华

/*通明色*/
background-color: transparent;

/*半通明*/
background: rgba(0, 0, 0, 0.5)

/*换色彩*/
background-color: #;

2.布景图片

/*钞缮实例 默许平坦的*/
background-image: url(c:/WEB/amag/a1.png);

/*不服展*/
background-repeat: no-repeat;

/*平坦*/
background-repeat: repeat;

/*x 平坦*/
background-repeat: repeat-x;

/*y 平坦*/
background-repeat: repeat-y;

页面既既可以添加布景图片 ,还可以添加布景物华,定位布景图片会压着布景物华


3.布景职位

/*程度居中垂直	,靠上*/
background-position: center top;

/*右边,物尺中心*/
background-position: right center;

省略一个,式盒第二个方位是定位居中
/*x y 按序不克不及倒置了*/
background-position: 20px 50px;

background-position: center 40px;


4.布景结实

/*结实*/
background-attachment: fixed;

/*随对象内容动弹*/
background-attachment: scroll;


5.布景复合型写法

/*布景物华,布景图片,布景布景地址
,物尺布景平坦,式盒布景图象动弹,定位布景布景图片职位*/
background: black url(c:/WEB/amag/a1.png) no-repeat fixed center top

#免责声明#

本站提供的一切资源、教程和内容信息仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络收集整理,版权争议与本站无关。