Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

<center><div>I'm centered!</div></center>


DRY, though, right? Changing one set of CSS rules is better than hunting down 20 <center> elements when requirements change. Not to mention <center> is deprecated.


When requirements change —

    center { text-align: left }


A simple search-and-replace is enough to get all the <center> elements... and chances are when the requirements change, that's the least of the structural changes you'll have to make. IMHO all the CSS purists do is overcomplicate things.


That works great vertically! </sarcasm> Did you even read the article?


Time to introduce a new tag into the standard!

<vertical-center>Hello!</vertical-center>


Relax, I'm not recommending anyone actually do it that way. I'm just old and found it humorous that something as simple as centering a div requires an entire article.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: