8

What does auto mean when I write:

:focus {
    outline: auto 5px -webkit-focus-ring-color
}

It is not documented here and I cannot find documentation elsewhere.

Randomblue
  • 112,777
  • 145
  • 353
  • 547
  • 1
    Better documentation for outline properties is now available on MDN https://developer.mozilla.org/en-US/docs/Web/CSS/outline – gapple Feb 25 '15 at 19:15

2 Answers2

5

You're using the shorthand for the outline-* properties; auto represents the value for outline-style and auto itself means that it's up to the browser to decide what to do based on the context of the element.

pimvdb
  • 151,816
  • 78
  • 307
  • 352
Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • Thanks. But what are the rules for determining what `auto` will be calculated to? – Randomblue Sep 24 '11 at 12:35
  • Its up to the browser, your example is the default :focus for webkit which seems to be a special case; http://stackoverflow.com/questions/4686580/equivalent-to-produce-field-glow-in-other-browsers – Alex K. Sep 24 '11 at 12:40
0

I would just like to point out that in IE auto doesn't show anything, and you'll have to explicitly declare what type of border you want to use. Alex K's link is a good demonstration of how other popular browsers work.

JDandChips
  • 9,780
  • 3
  • 30
  • 46