Kristin
Kristin

Reputation: 31

CSS border not showing up?

So, in my CSS code, I have the following:

img {
        border: 5px solid #fff;
        margin: 5px;
        position:relative;
        -webkit-box-shadow: 1px 1px 1px 1px #ccc;
        -moz-box-shadow: 1px 1px 1px 1px #ccc;
        box-shadow: 1px 1px 1px 1px #ccc;
            opacity: 0.5;
         filter: alpha(opacity=50); /* For IE8 and earlier */

However, the 5px white border is not appearing, just the shadow. What am I missing?

Edit: In response to all replies thus far, I obviously see that #fff is white, as I mentioned above, the "5px white border". I want it to be white.

What's happening is that there is NO border showing up at all, just the img with a shadow. But I want the 5px white border, then the shadow fall off of that. I've seen it elsewhere but for some reason it's not working for me.

Upvotes: 0

Views: 618

Answers (3)

sunjeep
sunjeep

Reputation: 128

change your color of border: 5px solid #fff; to something like #000.Your are not seeing border color because #fff denotes white color and your body background color is also white.

Upvotes: 1

Siddharth Thevaril
Siddharth Thevaril

Reputation: 3788

Your image has a border. You used #fff as the border color which is the HEX code for white. Change it to black or something darker.

Upvotes: 1

Tolga Ozses
Tolga Ozses

Reputation: 355

Your img has a border, but you can't see it since #fff is white (unless you've got a darker background).

Upvotes: 0

Related Questions