Posts Tagged ‘web developers’

Explain which div you’re closing

Most of the time when I’m viewing a website source, I see, at the very bottom of the page, an almost endless list of closing </div> tags. In fact, many beginners think they just have to use divs instead of tables to produce quality code. Divs are cleaners than tables, but without proper code organization, it can be as (or even sometimes more) messy as table based code.

Using indentation is a good start. But a tip that can definitely make you save lot of time is to comment every div tag you’re closing, as shown in the example below:

1.<div id="header">
2. <div id="sub" class="first left">
3. ...
4. </div><!-- #sub.first.left -->
5.</div><!-- #header -->
**************************************************** (more…)