Solved

background image and CSS border

Posted on 2009-07-01
5
570 Views
Last Modified: 2012-08-13
Hi, I am working on a new page, and have applied a CSS border to a background image, but the border does not appear to show in IE or FF.  

It seems I am missing something...any ideas?
http://www.trytest.net/amanda/gallery.php
0
Comment
Question by:wood1e
5 Comments
 
LVL 9

Expert Comment

by:hmare
ID: 24753641
As far as I know, borders are not supported on background images. You could use Photoshop or some other editor to add the border to the image itself.
0
 
LVL 3

Expert Comment

by:JPM
ID: 24753831
For instance, see this tutorial :
http://www.bigbaer.com/css_tutorials/double.border.background.css.template.htm

and common types of borders at       http://www.w3.org/TR/css3-background/

HTWH
0
 

Author Comment

by:wood1e
ID: 24754449
So border can be used with background image?
0
 
LVL 3

Expert Comment

by:JPM
ID: 24755887
It sounds like   ;)
0
 
LVL 6

Accepted Solution

by:
Tony O'Byrne earned 500 total points
ID: 24765020
Rather than applying a graphical border to the image, include the image in another <div class="imageborder"> block...  Use a class something like the class below. The div wouldn't care then if its contents are an image or text or a cow - it'll try to put a border around it regardless.

If that doesn't work, then just add some margin in the imageborder class - I don't know if the image will hide the border if the image and containing <div> are the same size.
.imageborder{
  border-width: 1px;
  border-style: solid;
  border-color: blue;
}

Open in new window

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Message not shown 5 50
Bottom border change 5 14
Change of column alignment in div 2 18
Customizing jQuery UI Accordion CSS 3 13
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 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