JezB
JezB

Reputation: 528

CSS Image Border

Probably a simple question this, but...

I can apply CSS to all images using img {} in the CSS.

Some of the images have a border specified in html (e.g. border="1") - from a WYSIWYG editor.

So, is there any way to specify in CSS that if the a border is specified, then it should be white?

Upvotes: 0

Views: 644

Answers (2)

Shawn Taylor
Shawn Taylor

Reputation: 3969

As there is CONDITION of IF border specified so

border:1px solid white;

would be wrong and instead mention only border color using property as

border-color:white; 

It will just set border color but not set border width as required.

Upvotes: 1

Mr Lister
Mr Lister

Reputation: 46619

border:1px solid white; or border-color:white;

Here, the official specs. Probably more than you want to know, but this is the formal reference. If other documents disagree, this is the authoritative one.

http://www.w3.org/TR/2011/REC-CSS2-20110607/box.html#border-properties

Oh, and the HTML attribute border="1" is deprecated. Better use CSS all the way.

Upvotes: 1

Related Questions