Last week our company had a skill test exam for front-end web developer vacancy. I sneak peek a couple designs and I found out some bad habits in their codes.
Here are the coding habits you would like to avoid.
Use the right tag for appropriate function.
Here is a bad vertical category list source code.
Example 1
Comment: overkill div tags
<div> Shop by Categories</div>
<div class=”business”>Business and Management</div>
<div class=”business”>Business and Management</div>
<div class=”business”>Business and Management</div>
<div class=”business”>Business and Management</div>
Example 2
Comment: dont use heading tags on your category list
<div class=”business_management”>
<a href=”#”><h2>Business and Management</h2></a>
</div>
<div class=”business_management”>
<a href=”#”><h2>Business and Management</h2></a>
</div>
<div class=”business_management”>
<a href=”#”><h2>Business and Management</h2></a>
</div>
Example 3
Comment: update your web development skills
<div class=”shopbycategories”><font class=”shopbycategoriesText”>Shop by Categories </font></div>
<div class=”greenleftBG”><font class=”businessmgtTEXT”>Business and Management<br>
Business and Management<br>
Business and Management<br>
Business and Management<br>
Business and Management<br>
Business and Management<br>
Business and Management<br>
</font><br>
Here is the correct way presenting your source code for vertical category list
Comment: your id=”category” will now take care of the styling
<div id=”category”>
<h2> Shop by Categories </h2>
<ul>
<li><a href=”#”> Business and Management</a></li>
<li><a href=”#”> Business and Management</a></li>
<li><a href=”#”> Business and Management</a></li>
</ul>
</div>
Remember you are coding for a vertical category “list” so you might as well use list tag and make use of li tags.

[...] bestwebbuzz.com Salva e condividi questo articolo: Queste icone linkano i siti di social bookmarking sui quali i [...]
I totally agree with using the proper elements for their intended function.
But…
For this example list why not use a ‘dl’?
Use the ‘dt’ for the heading, and ‘dd’ for the list. By default the browser will bold the ‘dt’ and have a ‘list-style: none’ for the ‘dd’.
By using the ‘dl’ you can also get ride of the extra div wrapper. And just give the ‘dl’ the id or class.
Just my 2 cents.
g spam lagi na niya iya divs og br tags doh?
I agree… better to use construction instead of that ugly h2! The title is symantically attached to the list.
oh it stripped out my tags haha.. again:
I agree… better to use a ‘dl’ / ‘dt’ / ‘dd’-'ul’ construction instead of that ugly h2! The title is symantically attached to the list.
[...] Newbie Web Developers Common Mistakes | Best Web Buzz common n00b mistakes! (tags: web) [...]
Great article.
[...] Newbie Web Developers Common Mistakes [...]
[...] Newbie Desenvolvedores Web: erros comuns [...]