• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

Obsolete HTML tags

cruzer323

New member
I've been thinking a lot recently about HTML tags, such as which ones I should use and which ones are too old (obsolete) to be necessary.
I'm thinking like this because I want to update my website, and I want it to look as good as possible in all kinds of browsers in as many versions of as many operating systems as possible.
Take the HTML tag <center> for example.
It was replaced with <div align="center"> and everyone phased out <center>.
So my question is this; Is it worth it putting in BOTH tags (like <center><div align="center">Text</div></center>) to ensure maximum compatibility?


Cruzer323
 
I want it to look as good as possible in all kinds of browsers in as many versions of as many operating systems as possible.
good luck buddy

So my question is this; Is it worth it putting in BOTH tags (like <center><div align="center">Text</div></center>) to ensure maximum compatibility?
not only is that invalid HTML, but it's doubly-wrong besides

<div class="whatever-this-is-that-makes-you-want-to-center-it">Text</div>

don't write garbage because you think someone's grandma might still use IE4
 
I pretty much think CSS classes/ids should only be made where important. If you're only going to only use something on one page, then use the style attribute to apply some CSS. But whatever floats your boat.
 
the entire point of using classes in the first place is to introduce semantics so your HTML describes what something is, not what you think it should look like at the moment. inline styles defeat that entirely no matter how practical it seems at the moment.

- you can't easily select and restyle the element with an alternate sheet, and neither can users who want to tweak your site
- when redesign time comes around, you'll have to go through your whole site looking for inline styles rather than working with just classes
- if you want to use that style again somewhere you have to go factor it out anyway before you can

I use inline styles only when the value could be one of millions, i.e. usually a background color or width generated by a script.
 
Back
Top Bottom