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

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: