手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >CSS 实用实例(推荐)
CSS 实用实例(推荐)
摘要:Background背景设置背景颜色body{background-color:yellow}h1{background-color:#00...

Background背景 设置背景颜色

body {background-color: yellow} h1 {background-color: #00ff00} h2 {background-color: transparent} p {background-color: rgb(250,0,255)} This is header 1 This is header 2

This is a paragraph

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

设置一张图片做为背景

body { background-image: url('http://www.blueidea.com/articleimg/2006/07/3744/bgdesert.jpg') }

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

垂直重复背景图片

body { background-image: url('http://www.blueidea.com/articleimg/2006/07/3744/bgdesert.jpg'); background-repeat: repeat }

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

水平重复背景图片

body { background-image: url('http://www.blueidea.com/articleimg/2006/07/3744/bgdesert.jpg'); background-repeat: repeat-x }

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

怎样放置背景图片(位置摆放)

body { background-image: url('http://www.blueidea.com/articleimg/2006/07/3744/bgdesert.jpg'); background-repeat: no-repeat; background-position: center; }

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

背景不滚动

body { background-image: url('http://www.blueidea.com/articleimg/2006/07/3744/smiley.gif'); background-repeat: no-repeat; background-attachment: fixed }

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

The image will not scroll with the rest of the page

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

背景属性一行解决(用一行文字定义背景属性)

body { background: #00ff00 url('http://www.blueidea.com/articleimg/2006/07/3744/smiley.gif') no-repeat fixed center; }

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

This is some text

[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]

【CSS 实用实例(推荐)】相关文章:

CSS伪类对象before和after的用法实例详解

CSS table 单行布局示例代码

CSS定位属性Position详解

用CSS+JS实现Li背景颜色交替

CSS3 实用技巧:实现黑白图像效果示例代码

CSS常用样式效果

CSS入门

CSS实现绝对底部

3款漂亮的CSS3 Loading动画实例教程

DIV CSS列形导航一例,超酷解析

精品推荐
分类导航