6.背景属性
来源:互联网 发布:元旦网络营销策划方案 编辑:程序博客网 时间:2024/06/06 03:30
background-color
背景颜色background-image
背景图片
background-image:url("1.png");
背景平铺
background-repeat:
repeat
默认平铺 |no-repeat
不平铺 |repeat-x
水平方向平铺,垂直不平铺 |repeat-
y 垂直方向平铺background-position
left | right |center |top |bottom 背景定位
特点:
(1)方位值只写一个时,另一个默认居中background-position:left;
(方向在左面,垂直方向居中)
(2)写2个方位值得时候,左右和垂直顺序没有要求。background-position:right buttom;
(3)只写一个center时,图片在中间。background-position:center;
(4)当写两个具体值时,第一个代表水平方向,第二个代表垂直方向。(只写一个数值时,则这个数值代表水平方向,垂直方向居中。)background-position:20px,30px;
- 背景是否滚动:
background-attachment: scroll | fixed;
scroll图片定位从元素的定位出发(默认)。
fixed图片定位从浏览器定位出发。
<head> <style type="text/css"> .box{ width:1400px; height:1500px; background-image:url("1.png"); background-repeat:no-repeat; background-position:bottom right; background;fixed; } </style></head><body> <div class="box">df<div></body>
- 背景属性连写:
background:red url("1.png") no-repeat bottom;
特点:连写时没有顺序要求,url为必写项,位置,重复等才会生效。
※清除列表项前面的小标
li{ list-style:none ;}
阅读全文
0 0
- 6.背景属性
- 背景属性
- 边框属性,背景属性,渐变
- css背景属性 Background
- android listView 背景属性
- 背景属性设置
- 9. CSS 背景属性
- css 背景属性
- CSS背景属性
- css3背景属性总结
- CSS之背景属性
- 0409 css背景属性
- 边框,背景属性
- CSS背景属性
- CSS2背景属性
- 12.背景属性
- CSS属性之背景
- 背景相关属性
- 【数据结构】迷宫(递归)
- jvm学习记录:GC
- 如何在Virtualbox的Ubuntu14.04系统中建立共享文件夹
- 学习Java注解及简单应用栗子
- SQL 基础教程
- 6.背景属性
- 如何解决秒杀的性能问题和超卖的讨论
- RabbitMQ --- Publish-Subscribe(发布-订阅)
- ReactNative了解(android)
- 有return的情况下try catch finally的执行顺序
- MFC创建具有滚动条的View
- tensorboard
- cmake 添加python.h相关库
- 什么是AJAX?