views:

40

answers:

4

Hi all,
As a web developer, I would like to know:

  1. What are the most common used html tags and when should I use (the context)?
  2. Do's and Don'ts of those tags
  3. What are the html tags which should not be used?

Thanks.

update: Yes, I understand that the best thing is to read the specification. But I think it will be great if there is short, easy to read, mostly used mini html spec. I'm looking the answers like:

  • difference usage of div and span.
  • usages of ul, ol, li, dl, dt, dd for different listing
  • b, i, font, strong tag should not be used. should use css
  • table should not be used for layout
  • tbody can be used for grouping table
  • a tag should not be used for link button for ajax request
  • button vs input tag
  • etc.
A: 

See http://www.w3.org/TR/xhtml1/

Robert W
+1  A: 

Decide on one of the specifications and stick to it. Any browser that supports a spec will render any tags defined in it.

The most widely used spec at this time is HTML 4.01, though there are many sites using XHTML 1.1 and HTML 5 is starting to gain traction, though it is not finalized yet.

The specs tell you exactly how the different tags should be used - if a tag is not in the spec or marked as deprecated/obsolete, do not use it. Any other tag can be used.

Unfortunately all specs leave room for interpretation, so things may not look exactly the same in each browser or not work exactly the same - you will still have to test across browsers.

Oded
A: 

those are questions related to semantic html. when to use which tags and what not to use: search for semantci html on google (this is a good link) (and this too)

Nealv
A: 

It sounds to me like you just need some general advice on coding semantic HTML. This isn't as strange a question as some here are making out, as there are a lot of different ways to code semantically.

First of all, read the specs for your chosen language. As posted already here's the XHTML 1.0 spec.

Secondly, give SitePoint's excellent references a try. They give excellent advice for those starting out and will help you if you ever need to go back and look at something.

Finally, for best practices, regardless of your ability level give A List Apart a try. They always have great articles that I occasionally go back to if I need to do something like overlay images on content or build nice, semantic forms.

Good luck!

EnderMB