0

I currently have something like this:

article > * { max-width: 800px; }

But people complain about using the universal selector. Short of manually typing each possible tag name (which I am bound to miss), what's the best way to do this without using a universal selector?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Jonathan Ong
  • 19,927
  • 17
  • 79
  • 118

1 Answers1

1

If you can fix the width of the article, there aren't many elements that may overflow if you don't set them explicitly to a larger size. So if you set

article, article div, article img {
    max-width: 800px;
}

you're probably OK. Add one if you see one missing.

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758
  • 1
    The two or three of them, yes... that means about 20 or 30 characters in your css. I never had to use `*` because when you set the size of an element, and don't set explicit random size to contained elements, there is no reason for overflow (except images). – Denys Séguret Sep 25 '12 at 06:54