Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Borders using images
- Hvid Hat
March 17, 2008, 4:14 pm
rate this thread
I want to create a layout where the content is surrounded by a frame, kinda
like a picture with a picture frame around it. My question is, how do I go
about this? Is this done by using divs for each border (top, right, bottom,
left) and giving the div a background image or is there a better way? In
my case, I can use a repeating image for the border. I just can't use the
same repeating image for all borders as the shadow for the borders differ.
Re: Borders using images
You can build borders or frames around an image using many image tools
such as Paint Shop Pro. The main disadvantage of this is when you want
the image to be of near full page size, in which case the image bit
size may become huge and be slow to download.
Another way is to build a gif picture frame with an empty interior for
content. I have a gold picture frame with empty interior at
http://cwdjr.net/geometric/goldframe.gif. This is 800 x 600 px, but
is only about 37 KB, which is fairly small for this size of image. By
using percentages for height and width for the image, you can fill or
nearly fill most page sizes commonly used without undue distortion of
the image frame. For some unknown reason, this gets the most hits on
my .net site. I don't use it much on my pages, and the few pages on
which I do use it don't get many hits, so I can only assume a lot of
people are hot linking to it. So far I have had no bandwidth usage
problems, but if I do or just wake up in a very bad mood, the frame
image will be renamed and perhaps replaced with something rude. So you
are welcome to even hot link to it for testing, but if you decide to
use it please download it.