Chinaunix首页 | 论坛 | 博客
  • 博客访问: 96135
  • 博文数量: 34
  • 博客积分: 925
  • 博客等级: 准尉
  • 技术积分: 350
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-15 11:52
文章分类

全部博文(34)

文章存档

2011年(34)

我的朋友

分类: 系统运维

2011-08-18 14:35:12

CSS Layers

In CSS, layers refer to applying the z-index property to elements that overlap with each other.

The z-index property, when used in conjunction with the position property, enables you to specify which element should appear on top in the event of an overlap. An overlap can easily occur when using the position property, and this is often desirable when creating advanced layouts.

Example code:

  1. <div style="background-color:red;
  2.     width:100px;
  3.     height:100px;
  4.     position:relative;
  5.     top:10px;
  6.     left:80px;
  7.     z-index:2;">
  8. </div>
  9. <div style="background-color:yellow;
  10.     width:100px;
  11.     height:100px;
  12.     position:relative;
  13.     top:-60px;
  14.     left:35px;
  15.     z-index:1;">
  16. </div>
This results in:
阅读(277) | 评论(0) | 转发(0) |
0

上一篇:CSS Float

下一篇:gvim 编辑器常用配置

给主人留下些什么吧!~~