|
|
|
|
![]() ![]() |
Aug 7 2005, 01:19 PM
Post
#1
|
|
|
Sorry for not being active, Uni :( ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 933 Joined: 24-August 04 From: South Wales, UK Member No.: 892 |
Im going to show you very simply how to create boxes with Shadows using div tags and css, no images needed, meaning fat pageload times!
You simple need to create two layers, one behind the other, the one behind will have a top and left margin on 20px, the one infront 10px, set teh background colour of the one behing darker than teh one infront, you should end up with something like this: ![]() Here is th html to create this effect: CODE <div id="Layer1" style="position:absolute; left:15px; top:15px; width:400px; height:200px; z-index:1; background-color: #000066; layer-background-color: #000066; border: 1px solid #000000;"></div> <div id="Layer2" style="position:absolute; left:10px; top:10px; width:400px; height:200px; z-index:2; background-color: #0099FF; layer-background-color: #0099FF; border: 1px solid #000000;"></div> Its as simple as that, two divtags, a bit of css, no images This post has been edited by OpaQue: Aug 7 2005, 08:43 PM |
|
|
|
Aug 7 2005, 01:33 PM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 378 Joined: 13-October 04 From: Slovenia Member No.: 1,731 |
Nice one
|
|
|
|
Aug 7 2005, 08:35 PM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 702 Joined: 17-February 05 Member No.: 3,817 |
Really cool. Somewhere in someone's webpage I saw something like this when I tried to right-click no images was coming and I was wondering how he did it. Thanks for sharing it here.
Keep sharing those with us. |
|
|
|
Aug 7 2005, 08:38 PM
Post
#4
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 128 Joined: 6-August 05 Member No.: 10,402 |
wow, thats nicely done =D. I never knew with such simple CSS coding you could get such a good outcome
|
|
|
|
Aug 7 2005, 09:58 PM
Post
#5
|
|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 1,161 Joined: 9-May 05 From: Brisbane, QLD Member No.: 6,818 |
QUOTE(cragllo @ Aug 7 2005, 11:19 PM) CODE <div id="Layer1" style="position:absolute; left:15px; top:15px; width:400px; height:200px; z-index:1; background-color: #000066; layer-background-color: #000066; border: 1px solid #000000;"></div> <div id="Layer2" style="position:absolute; left:10px; top:10px; width:400px; height:200px; z-index:2; background-color: #0099FF; layer-background-color: #0099FF; border: 1px solid #000000;"></div> One flaw with this method is that you've given absolute positioning to your first element. You can achieve the same result without absolutely positioning your first element like this: CODE <div id="Layer1" style="width:400px; height:200px; z-index:1; background-color: #000066; layer-background-color: #000066; border: 1px solid #000000;"> <div id="Layer2" style="position:absolute; left:5px; top:10px; width:400px; height:200px; z-index:2; background-color: #0099FF; layer-background-color: #0099FF; border: 1px solid #000000;"></div></div> The second <div> is positioned absolutely in relation to the first (ie it's inside the first div). I've just posted this in another thread, but it seems relevant to this one too: CSS dropshadows (with feathered edges). |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 25th July 2008 - 10:43 AM |