Understanding Style Sheets (part 2) - The Z-Factor (Page 8 of 8 )
And finally, when you're talking about positioning, you can't omit the "z-index" property, which allows you to specify the "stacking order" of layers placed one above the other. A higher z-index value pushes an element up, while a lower value pulls it down (relatively speaking, of course.)
One of the more common uses of the "z-index" property is to create a drop shadow - the next example will demonstrate this: v
<HTML>
<HEAD>
<STYLE TYPE="text/css">
.level1 {position: relative;
top: 15; left: 25; z-index: 10; color: #00000;
font-family: Arial; font-size:25pt}
.level2
{position: relative; top: -22; left: 28; z-index: 6; color:
#ADADAD; font-family:
Arial; font-size:25pt}
.level3 {position: relative; top: -59; left: 29; z-index:
6; color:
#ADADAD; font-family: Arial; font-size:25pt}
</STYLE>
</HEAD>
<BODY>
<DIV
CLASS="level1">Scared of my shadow? Nah!</DIV>
<DIV CLASS="level2">Scared
of my shadow? Nah!</DIV>
<DIV CLASS="level3">Scared of my shadow? Nah!</DIV>
</BODY>
</HTML>
That just about covers most of the common style sheet properties you'll be using.
There are quite a few more defined in the official specification, but they're plagued by spotty or no browser support, which reduces their usefulness substantially. If you're interested, though, do check out the official CSS2 specification, available at
http://www.w3.org/TR/REC-CSS2 See you soon!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |