手机
当前位置:查字典教程网 >网页设计 > 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应用基础教程:区块性质

CSS实现绝对底部

CSS实现图片圆角化处理

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

CSS网页布局实用小技巧

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

CSS实战:用dl、dd、dt做一个网页表单

CSS定义标题的实例讲解

CSS技巧:使用calc()做算术

HTML DIV+CSS制作通栏实例

精品推荐
分类导航