最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
css教程:CSS背景background属性的应用
时间:2022-07-02 12:42:39 编辑:袖梨 来源:一聚教程网
The CSS background properties define the background effects of an element.
CSS的background属性可为元素定义背景效果。
设置背景颜色 Set the background color
This example demonstrates how to set the background color for an element.
实例:
| 代码如下 | 复制代码 |
| body {background-color: yellow} h1 {background-color: #00ff00} h2 {background-color: transparent} p {background-color: rgb(250,0,255)} |
|
标题一
标题二
段落
[ 可先修改部分代码 再运行查看效果 ]
设置背景图片 Set an image as the background
This example demonstrates how to set an image as the background
实例:
| 代码如下 | 复制代码 |
| body { background-image:url('attachments/month_0612/52006129151936.jpg') } |
|
[ 可先修改部分代码 再运行查看效果 ]
重复背景图片 How to repeat a background image
This example demonstrates how to repeat a background image.
实例:
| 代码如下 | 复制代码 |
| body { background-image: url('attachments/month_0612/52006129151936.jpg'); background-repeat: repeat } |
|
[ 可先修改部分代码 再运行查看效果 ]
背景图片水平重复 How to repeat a background image only horizontally
This example demonstrates how to repeat a background image only horizontally.
实例:
| 代码如下 | 复制代码 |
body { background-image: url('attachments/month_0612/52006129151936.jpg'); background-repeat: repeat-x } |
|
[ 可先修改部分代码 再运行查看效果 ]
背景图片垂直重复 How to repeat a background image only vertically
相关文章
- 虾米音乐如何恢复删除的歌单 05-27
- 恐龙神奇宝贝手游恐龙养成攻略 恐龙神奇宝贝手游新手恐龙培养与进阶技巧 05-27
- 全能扫描王使用操作相关问题详情 05-27
- 雷霆大战手游T0船长推荐 雷霆大战手游最强船长阵容与培养指南 05-27
- 铸兵之王开荒指南 铸兵之王新手入门全流程攻略 05-27
- 《快手》号修改方法 05-27