Solved

background image and CSS border

Posted on 2009-07-01
5
569 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
Comment Utility
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
Comment Utility
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
Comment Utility
So border can be used with background image?
0
 
LVL 3

Expert Comment

by:JPM
Comment Utility
It sounds like   ;)
0
 
LVL 6

Accepted Solution

by:
Tony O'Byrne earned 500 total points
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

728 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

14 Experts available now in Live!

Get 1:1 Help Now