Quackit Logo

FREE Hosting!

With every domain name you register with ZappyHost, you get FREE hosting.

$1.99 Domain Names

With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.

CSS Layers

Print Version

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:

<div style="background-color:red;
	width:100px;
	height:100px;
	position:relative;
	top:10px;
	left:80px;
	z-index:2;">
</div>
<div style="background-color:yellow;
	width:100px;
	height:100px;
	position:relative;
	top:-60px;
	left:35px;
	z-index:1;">
</div>

This results in:

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
               
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!