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

Was the <center></center> tag really that bad after all?


<center> is a text-level element, not block layout control.


If you allowed it to control blocks, you could consider it a semantic tag with reasonable defaults.


so how do you center that vertically?

I consider it only slightly less offensive than <blink> as being useless. I also find it incorrect from attempting to have the markup dictating the layout. Sure, this was before CSS was robust, but it is one of the reasons that I just had no problem with it going the way of the dodo.


The <blink> element has never been part of any HTML standard.


your point? whether it was or wasn't has no bearing on its uselessness


I'm following on to another comment where someone uses a 20 year obsolete tag as an example of something.


and how old do you think the <center> tag is?


More than 20 years old but it doesn't matter. Use CSS and not an obsolete element.

Just checked. It was standardized in HTML 3.2. Deprecated in HTML 4 Made obsolete in HTML5


You can't modify this without touching html. Just create a div and assign class so you only modify CSS later.


What would stop it from being styled by CSS in the same way? You could use it for semantic markup.


It would be messy. If <center> element is used somewhere else then you will have to find its parent classes. If they don't have proper parent div classes or <center> used in many places then you will have to individually target <center> elements like div > div > div > center and another one div > div > div > div > center.

You can override center too but why would you try that instead of creating a class for a div and addressing it properly. Classless elements cause long-term issues when modified with CSS.




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

Search: