Jump to content

Drop Shadows with CSS


chiprivers

Recommended Posts

Now that's pretty cool ... and it's OLD if the author is concerned about the evil Netscape 4!

 

It works fine in FF and IE6. Here is the test run code:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
.box { float: left; width: 100px; height: 100px; }
#boxContent { border: none; background: #9FC; }
#boxContent { position: relative; left: -2px; top: -2px; }
#boxContainer { position: relative; background: #666; margin: 4px; }
</style> 
</head>

<body>
<div class="box" id="boxContainer">
<div class="box" id="boxContent">
A drop shadow around a box
</div>
</div>
</body>
</html>

Link to comment
Share on other sites

It validated fine and works in Firefox and IE.

 

I'll check out Safari, Opera and Konquerer.

 

Frankly, the only browsers I could see it potentially not working in would be old IE 5 win and Mac and Old Netscape. And at this point, most designers have stopped trying to accommodate those dinos anyway - it's too easy to update IE to at least 6 and anyone using Netscape 4 has no idea what the web looks like anyway.

 

As for text-based browsers ... well ... they wouldn't see the graphic either.

 

HOWEVER, I don't know if the technique will work on an image (which I now realize is what chiprivers asked).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.