Why no-repeat?

By Deane Barker on February 27, 2006

Here’s something I would like explained: why can’t I use “none” as a value for the “background-repeat” CSS property? To get a background to stop repeating, the correct value is “no-repeat.” Why? It’s “none” on everything else in CSS — why the change for this one thing?

Gadgetopia

Comments

  1. Probably because the background-repeat option can be specified together with the other background options, such as background: uri(‘images/bg.png’) no-repeat; in that case none would be interpreted as background: none.

  2. In practice it could have been done (using ‘none’ for both -image and -repeat), like it is for various other properties. But… it wasn’t. No particularily good reason really. Bert and howcome probably just thought ‘no-repeat’ made more sense than ‘none’.

Comments are closed. If you have something you really want to say, email editors@gadgetopia.com and we‘ll get it added for you.