TUTORIAL: CSS Drop Shadow Background Effect Easily add a Background Drop Shadow Effect for your Website
#41
Posted 13 October 2008 - 11:51 AM
#42
Posted 30 April 2009 - 07:25 AM
with regards
#43
Posted 30 April 2009 - 09:52 AM
I had ago at this and had trouble laying out the divs with the shadow effect because they didn't want to run the length of the main content div?
went for fixed width in the end but would like to know the answer for the next time I need it!
#44
Posted 31 December 2009 - 07:06 PM
I have a very basic understanding of HTML. But advanced PS.
I am trying to apply the drop shadow to a blogger template... is this tut possible solely in HTML?
I have trying a work around off my basic knowledge but I seem to be failing, it may be a bit of a newb question but could you let me know!
Thanks in Advance!
#45
Posted 31 December 2009 - 08:01 PM
mlcuthell, on 31 December 2009 - 07:06 PM, said:
I have a very basic understanding of HTML. But advanced PS.
I am trying to apply the drop shadow to a blogger template... is this tut possible solely in HTML?
I have trying a work around off my basic knowledge but I seem to be failing, it may be a bit of a newb question but could you let me know!
Thanks in Advance!
Yes!
http://owltastic.com...adows-and-css3/
For text:
text-shadow: 1px 1px 1px rgba(0,0,0,.4);
Numbers = Offset from middle, Offset from middle, Sharpness of shadow, rgba(red,green,blue,opacity)
For boxes:
-webkit-box-shadow: 0px 0px 10px 5px rgba(0,0,0,.5);
-moz-box-shadow: 0px 0px 10px 5px rgba(0,0,0,.5);
box-shadow: 0px 0px 10px 5px rgba(0,0,0,.5);
(webkit/moz are because they are currently unsupported css properties. You have to use -webkit to get it to work in Safari/Chrome and -moz for Firefox.)
Numbers = Offset from middle, Offset from middle, Sharpness of shadow, Thickness of shadow, rgba(red,green,blue,opacity)
Rounded corners:
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
#46
Posted 01 January 2010 - 10:28 PM
Still in the body section? Do I just add that code alone?
I have created the jpeg as per the tut... A further breakdown would be very helpful thanks!!! I want to apply it to the wrapper on this website
Link to web
Thanks.
#47
Posted 15 March 2010 - 01:08 PM
#48
Posted 08 April 2010 - 12:13 AM
#49
Posted 29 April 2010 - 07:29 AM
<head>
<script type="text/javascript" language="javascript">
/* Method To Generate Random Numbers Between "0-255" for RGB Color-code Format & Assign To Body-Backgrond-Style */
function bgDisco()
{
var x =Math.round(255*Math.random());
var num1 =getHex(x);
var y =Math.round(255*Math.random());
var num2 =getHex(y);
var z =Math.round(255*Math.random());
var num3 =getHex(z);
document.body.style.background="#"+num1+num2+num3;
setTimeout("bgDisco()",1000);
}
/* Method To Convert Decimal To Hexadecimal */
function getHex(dec)
{
Eliza
#50
Posted 02 May 2010 - 01:19 PM
#51
Posted 16 July 2010 - 05:12 AM
#52
Posted 01 September 2010 - 01:24 PM
Ben, on 22 October 2006 - 07:07 PM, said:
A very easy to follow tutorial on how to quickly create a drop shadow background effect for your website using a small 1px high image and a touch of CSS. EASY!
For a live example: Click Here
Note:
I'll be demonstrating this using Macromedia Fireworks, but any other product is fine, i.e Photoshop, Paintshop Pro etc.
Step 1.
Create a new blank canvas with the dimensions 1024 x 1000 pixels in your favorite image editing software.
Give the canvas colour the attribute #F7F4EE
Step 2.
[See attached image for this step]
Create a white rectangle measuring 768 x 900 pixels in the middle of the canvas.
Apply a glow effect to the rectangle, give the glow a dark grey colour I would suggest #666666 and drop the opacity of the glow to 20%. In fireworks it automatically gives a wide spread of shadow, simply adjust the spread to 3 and the fade to 7 with an offset of 0 (See attached image) - If you are using software other than fireworks simply adjust the properties until you have your desired shadow/glow effect.
Step 3.
Rather than using the whole image you have just created, we are going to cut out a 1px high slice spanning the width of your whitebox and the shadow you just created in Step 2. Fireworks has a great tool called "Fit Canvas" - which crops the canvas to the dimensions of all the elements on your screen and removes any unused space. This quickly gives you shadow with equal widths either side of the white rectangle. (See 2nd attached image)
To do this simply use the shortcut Ctrl+Alt+F or Modify -> Canvas -> Fit Canvas.
Now goto Modify -> Canvas -> Canvas Size -> Give it a height of 1px. (This will make sense later)
Goto File -> Export Wizard -> The Web -> Export is as a .jpg (gif's normally don't blend the shadow as well)
Name the image: background.jpg (Put this in your website images foloder)
Result: You will have now created a 1px high image that we can now use to give your website a drop shadow effect.
Note: If you are using image software other than Fireworks and don't have the "Fit canvas" tool - Export the image using a slice measuring 1px high spanning the width of your White Rectangle and Shadow you created in Step 2. Make sure the width is an even number and has covers equal ammounts of shadow either side.
Step 4.
Create a stylesheet and call is styles.css and save it in the root of your website.
Now in Step 3 we created a 1px high image of your background, using CSS we are going to tile (repeat) this image vertically giving you a drop shadow effect no matter how far your website scrolls downwards.
We are going to apply this to the BODY of your website.
Add the following code to your styles.css file:
body {
background-image: url(images/background.jpg); /** Link to the image you created **/
background-repeat: repeat-y; /** Repeats the image vertically **/
background-position: center; /** Centers the Background image **/
background-color: #f7f4ee; /** Website BG colour (matches canvas colour in Step 1) **/
}Open up your favorite Web Editing software create a new document and call it index.html and save it in the root of your website folder. Now to link to the stylesheet you created add the following into the <head> of your document:
<link href="styles.css" rel="stylesheet" type="text/css" />
To make sure everything sits central when you start to add content to your website put it within a master container:
For example: within the <BODY> of your website add <div id="container">Content Here</div> - where it says "Content Here" - add all your website content within there.
with the style:
#container {
width: 768px;
margin: 0 auto;
text-align: center;
} And that's it! You have now created website with a drop shadow effect that you can add easily add content to.
For a live example: Click Here
#53
Posted 13 September 2011 - 08:18 PM
#54
Posted 13 September 2011 - 09:09 PM
Eg:
box-shadow: 3px 3px 4px #000;
#56
Posted 23 December 2011 - 11:18 PM
#57
Posted 29 December 2011 - 03:49 AM
omghi2u, on 23 December 2011 - 11:18 PM, said:
Fixed the 1pixel issue with my layout, looks great. However I'm still having the issue with the background image running all the way down past the content holder. Below is what I have in my style sheet. I have attempted to put the BG Image into #wrapper but it wont' appear. Only time it will appear is when I have it in the body of the css.
body {
margin: 0;
top: 0;
padding:0;
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
background: #ffffff;
background-position: center;
background-image: url("../Images/background.jpg");
background-repeat: repeat-y;
}
#wrapper {
margin: 0 auto;
width: 922px;
}
Help
















