Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

background image and CSS border

Posted on 2009-07-01
5
Medium Priority
?
581 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 1500 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
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 tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Suggested Courses

773 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