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
  • 665,005
  • 155
  • 1,345
  • 1,328
Jonathan Ong
  • 19,086
  • 15
  • 76
  • 115

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
  • 355,860
  • 83
  • 755
  • 726
  • 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