5 ms·
Was the <center></center> tag really that bad after all?
by ok123456 3y ago
Was the <center></center> tag really that bad after all?
- sonofhans 3y ago<center> is a text-level element, not block layout control.
- ok123456 3y agoIf you allowed it to control blocks, you could consider it a semantic tag with reasonable defaults.
- system2 3y agoYou can't modify this without touching html. Just create a div and assign class so you only modify CSS later.
- ok123456 3y agoWhat would stop it from being styled by CSS in the same way? You could use it for semantic markup.
- system2 3y agoIt 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.
- dylan604 3y agoso 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.
- assimpleaspossi 3y agoThe <blink> element has never been part of any HTML standard.
- dylan604 3y agoyour point? whether it was or wasn't has no bearing on its uselessness
- assimpleaspossi 3y agoI'm following on to another comment where someone uses a 20 year obsolete tag as an example of something.
- dylan604 3y agoand how old do you think the <center> tag is?
- assimpleaspossi 3y agoMore 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