|
There's a few things worth responding to in your comment, some technical and non-technical, but both important for beginners to keep in mind. I assume you know most of what I'm going to say, so I'm pretending a student asked this. So, what's the problem with the <center> tag? First, at the purely technical level, <center> was deprecated in HTML4.01 and is not part of HTML5 at all. As far as I know browsers will still render it fine, but it's technically not valid HTML5. Second, <center> was deprecated along with other tags like <font>, <blink>, <big>, and <strike> because of a popular movement in the late 90s to encapsulate the logical and semantic structure of the document in HTML and the display structure in CSS. So, there's a case to me made for not using it as a Best Practiceâ„¢, irrespective of the technical details about what browsers do or don't do, whether it's deprecated or not, etc. Third, other people take your code as a reflection of what was going on inside your head when you wrote it. Your HTML and other code exists in a cultural milieu whether you like it or not. Potential employers will certainly read these sorts of things into your code, so if you care about that then you should care about what they'll think when they see you using the <center> tag. In sociolinguistics there's an idea of the "prestige" of a dialect. For example, in the US, someone speaking Received Pronunciation (http://www.youtube.com/watch?v=bIemPxHSb6Q&t=6m28s) will be perceived as more educated and worldly while something speaking with a thick Appalachian accent (http://www.youtube.com/watch?v=03iwAY4KlIU) might be perceived as a hillbilly. It's relative to both the listener and the speaker, of course, so someone might think someone with an RP accent is a snob or find solidarity in in a shared-but-low-prestige identity (cf. http://www.youtube.com/watch?v=d7CzHFWsXQQ). The <center> tag is a marker for a low prestige dialect of HTML authorship. The fact that the OP got mildly reprimanded for using it is actually a sign of that. Folks will take its use as a sign that the author is an amateur and doesn't know that much about HTML. And if she were to use a <font> tag, oh buddy -- let slip the dogs of war! This isn't inherently true, of course. If I sat down and wrote some HTML using center tags I wouldn't suddenly know less about HTML, but that's the default presumption. This might not seem fair, but be honest: what would be your default, automatic reaction to someone using the <blink> or <marquee> tags non-ironically? Like someone moving to a foreign country for the first time, you'll pay a price if you don't understand the parameters of the culture in which you've decided to participate. Even if you disagree with the "cultural" conclusions, e.g., you think <center> is fine in certain situations, you should have an idea of how other folks might take it. Otherwise you'll be surprised, confused, and perhaps a little hurt when folks push back. |
I'm currently working on a very HTML/JS heavy open source project and a co-developer had included some center and bold tags in the code. I will instead replace them with em/strong and inline:center; since I would not like our project to be judged by our absense of "best practice".