Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Borders applying font color in CSS

Tags:

css

As CSS beginner I noticed that if you do not declare border color in a shorthand form, but before that you declare font color, that color will apply to the former as well e.g.

#crazyElement {color:red; border:1px solid;}

both will be red. Moreover, if you declare font color for the body, each border without declared color in shorthand form will apply that color also.

Is this normal? Maybe it's nothing special, but as a novice I just wanted to check...

like image 806
vucibatina Avatar asked Feb 16 '12 16:02

vucibatina


1 Answers

That is normal, and perfectly inline with the specification

If an element's border color is not specified with a border property, user agents must use the value of the element's 'color' property as the computed value for the border color.

via @BoltClock CSS3 Spec. and the currentColor which is how it is defined.

like image 78
Andrew Avatar answered Sep 21 '22 06:09

Andrew