Solved

Shadow/image around div or table

Posted on 2008-06-12
6
833 Views
Last Modified: 2013-12-25
Very simple question that I cannot find the answer too.  I have a table or div on a site and I want to add like a drop shadow/image around the border of that div or table.  

How can I achieve this, either through CSS or HTML.

Check this site out for a good example:
http://www.infusystem.com
0
Comment
Question by:LZ1
  • 3
  • 2
6 Comments
 
LVL 10

Accepted Solution

by:
bluefezteam earned 250 total points
Comment Utility
If you are using a table, this will be quicker to explain.
create a 3 by 3 table

the outer edge cells will hold your shading - the centre cell is for your content.

In photoshop(or similar) create a drop shadow effect which is 10px deep: start with a white square and apply the drop shadow effect, then you need to slice up the shadow into corners and sides. you should end up with corner pieces 10px x 10px and a side and top piece which is 10px x 1px.

With the 4 corners of the shadow you simply drop them into the corner table cells, and give the cells a height and width of 10px; for the sides and top you need to set those images as the BG image for those cells so they will repeat as the table gets longer.

Hope that makes sense.

Heres another tutorial

http://forums.digitalpoint.com/showthread.php?t=374316
0
 
LVL 10

Expert Comment

by:bluefezteam
Comment Utility
0
 
LVL 30

Author Comment

by:LZ1
Comment Utility
The tutorials you provided were ok, but what about making it scalable?  I don't want to have to do it each time I create  a new web page.  
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 5

Assisted Solution

by:Devario Johnson
Devario Johnson earned 250 total points
Comment Utility
have a 1px X 1 px image that is your bg but have it repeat X or Y based on if it's the sides or the top / bottom....

then use images for the corners that are similar to the 1 X 1 px ones...it will create the illusion of a image all around (shadow) and it will be scalable based on any dimension.
0
 
LVL 10

Expert Comment

by:bluefezteam
Comment Utility
The solution is scalable - with the sides and top set as BG images, when you stretch the table in either direction, the table will grow and the BG images repeat

It will be scalable
0
 
LVL 30

Author Comment

by:LZ1
Comment Utility
Thanks guys, I got it.  Works like a charm!!!
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
In this tutorial viewers will learn how to select a color range in Photoshop and how to easily apply them to multiple projects. Open an image for editing in Photoshop: Open the select Color Range Selection tool by going to Select > Color Range: Sele…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now