Every coder has his/her own coding style based on personal preferences. Not all of us markup the document in a same way. Some decide to choose one element while other coders prefer some other solution. In this article I will list 5 of my most usual coding preferences and explain my reasons.
Unordered list vs any other element in navigation

This is very popular way to markup navigation items for obvious reason: it is a list of links. That alone should be reason enough to choose this kind of marking up the content and go an extra mile to remove the list's default styling and apply something more suitable.
One more benefit that this markup provides a bunch of elements to work with using CSS. You have a parent list element and each link is also wrapped inside a list item. It's more than you can wish for :)
<ul> <li><a href="#">Nav item 1</a></li> </ul>
Paragraph vs list in breadcrumbs

This is open for debate and please let us all know if you have another opinion in comments. I personally like to use the following code pattern for breadcrumb trail (however I don't always use the » symbol):
<p id="breadcrumbs"><a href="#">Home</a> » <a href="#">About Us</a> » <a href="#">History</a></p>
Breadcrumb trail is a hierarchical path to a certain page. One of the logical thing to do is using nested lists to display this hierarchy. But what is a point of having nested lists if you have only one item in each list? More so, I really feel that breadcrumb trail should be presented linear.
Button vs input

I can't remember when was the last time that I used input type="submit". I abandoned that element a long ago. A couple of reasons why button element rock and input type="submit" doesn't: Button is its own element, that makes it easier to identify in the source code, easier to select with css (not all browsers out there support attribute selectors). It also allows use to put child elements inside it so it expands our styling possibilities.
<button type="submit">Submit Form</button>
Ordered list vs unordered list in comments

Lists are great. Really. There are 3 different types of lists (ordered, unordered and definition list) and each has its purpose. If you have doubts when to use ordered and when to use unordered try to shuffle the items randomly and see if the content still makes sense. Comments are somewhat of a textbook example of using ordered list because of their chronological, ascending linear nature. Each comment comes with a certain time stamp so comments must appear in that order.
<ol class="comments"> <li> <ul class="meta"> <li><img src="path-to-gravatar.gif" alt="Author's name" /></li> <li><a href="url-to-authors-homepage.html">Author's name</a></li> <li>posted on date-goes-here</li> </ul> <div class="body">Comment text goes here...</div> </li> </ol>
Div vs any other element in wrapping label / input field

What is the best choice of element to be used as a parent for input field and its related label?
<label for="contactName">Your Name</label> <input type="text" name="contactName" id="contactName" class="field" />
There has been some discussions on this site a while ago about the proper markup. After a while I settled with using DIVs:
<div> <label for="contactName">Your Name</label> <input type="text" name="contactName" id="contactName" class="field" /> </div>
The label and associated form control can be described as a section. DIV element has very wide semantic quality and it fits into every situation.
Jaina 7 Jan, 2010
Is there any particular reason why you should have a parent field for a label and its input field? Would it just be for styling purposes or something more semantic?
cssglobe 7 Jan, 2010
Nikola Plejić 7 Jan, 2010
cssglobe 7 Jan, 2010
Carlos Andre Ferrari 7 Jan, 2010
cssglobe 7 Jan, 2010
Stu Greenham 7 Jan, 2010
indie_preneur 7 Jan, 2010
Jon Hartmann 7 Jan, 2010
Stuart W 7 Jan, 2010
Sean 7 Jan, 2010
Jordan Walker 7 Jan, 2010
Andy Ford 7 Jan, 2010
I've heard good arguments for doing breadcrumbs in an ordered list. In fact the argument uses the same logic you used to support ordered lists for comments: "try to shuffle the items randomly and see if the content still makes sense".
However I don't have super strong opinions on breadcrumb nav. A nested list is probably technically the most semantic way to do it, but is just markup overkill. So I usually use an OL as it provides a lot of hooks to work with.
Thanks for starting this conversation!
Mike 7 Jan, 2010
Another element I use a lot is the <q> for quotes in a paragraphh - again, it's stylable, rather than using &ldquot; etc.
Also I find structurally [both with CSS enabled and disabled] a definition list is so under used - try it and you'll soon see how great they are!
Wladia Viviani 7 Jan, 2010
It'd be my semantical bet since it's intended for subsets of a form.
Rafi B. 7 Jan, 2010
@Wladia: You should use a FIELDSET for grouping a bunch of labels and inputs, not for each one.
Jaine......I LOVE WEB DESIGN 7 Jan, 2010
Muchas gracias!
Jay Tillery 7 Jan, 2010
Tim 7 Jan, 2010
I'm not sure about using OL over UL for comments. Your explanation makes sense in most cases, but falls short if the site is listing comments newest to oldest. (Whether or not comments should ever be listed newest to oldest is a whole different argument.) I don't necessarily disagree, but personally will always use UL unless it is an actual numbered list.
Susan R 7 Jan, 2010
David Hucklesby 8 Jan, 2010
Feedback from screen reader users would be valuable here...
cssglobe 8 Jan, 2010
Sean 8 Jan, 2010
Important: If you use the button element in an HTML form, different browsers will submit different values. Internet Explorer will submit the text between the <button> and </button> tags, while other browsers will submit the content of the value attribute. Use the input element to create buttons in an HTML form.
Marco Barbosa 8 Jan, 2010
Thanks for shargin!
viettel adsl 9 Jan, 2010
Wladia Viviani 9 Jan, 2010
wouldn't it be semantically better than a div for grouping label+input ( = a one-member subset - still a subset - of a form)?
prlamnguyen 9 Jan, 2010
Thanks for sharing your awesome tips, Alen! I realized that using the div element for wrapping input fields is awesome!
zwire 9 Jan, 2010
Thanks for shargin!
Sandeep 9 Jan, 2010
????? ??????? 10 Jan, 2010
????? ??????? 10 Jan, 2010
dave 11 Jan, 2010
shpyo 12 Jan, 2010
hannes 13 Jan, 2010
@????? ???????
button-tags are reacting on "enter". or what do you mena with stanard, buttons? button type=submit does.
breadcrumb:
for breadcrumbs I use an unordered list, because in my case normally it's longer then three entrys. in that case it makes sense to me to use a list.
forms:
for longer forms I use the dl/dd/dt combination for labels and form-elements. with a bit of css, that is looking perfect, even without css.
Chotrul Web Design and SEO 15 Jan, 2010
One of the things I love though about how the whole process of standards and semantic markup is maturing, is the enormous amount of development and sharing of ideas on these things. The internet community is truly a wonderful thing.
SMiGL 19 Jan, 2010
çabuk zayiflama 31 Jan, 2010