tags:

views:

46

answers:

1

I have a div with an id of 'gallery' and I want to style the images inside it. Specifically, I want to give each of the images a 1px solid yellow border except on the bottom because they sit on top of each other, so I don't want to double the border on the bottom.

What I'm confused about is how to choose between the different border style elements: border, border-style, border-width. I tried this:

div#gallery img
{
    border-width:1px;
    border-style:solid;
    border: solid yellow;
    border: 1px 1px 0px 1px;
}

I managed to get a yellow border with this css above but the border seems more like a 2px border - it's quite thick - and, besides that, the syntax I'm using doesn't look very elegant.

Any recommendations on how to do this more concisely/elegantly?

+3  A: 

I think this is the best way:

border: 1px solid yellow;
border-bottom: none;

The syntax for the border declaration goes width style color and affects all four borders. After that, you can override the bottom back to using no border by declaring border-bottom as none.

Paolo Bergantino
Ah!! So border-width, border-style, border-bottom, etc can be used to override elements of 'border'. Thanks. Makes sense now.
ipso facto