The reason for writing navigation with the most commonly used unordered list is obvious, it represents a column of links, which in itself has sufficient reason to choose the list label. But the default style of the list list needs to be removed to make it more meaningful.
Another benefit may exceed your imagination: you create a list list and add a link to it. Use css to control the definition of a series of elements in the list list.
<ul><li><a href=#>Collect and share</a></li></ul>2. Path (bread crumb): p paragraph label to list list label
We can discuss this issue together, please let us know if you have any other better ways. Personally, I prefer to write paths (bread crumbs) with the following code. (However I don't use >> symbols often).
<p id=breadcrumbs><a href=#>Home</a> » <a href=#>About Us</a> </p>
The website path (bread crumb) has a hierarchical relationship in a certain page. In theory, the list should be nested to display the hierarchical relationship, but if there is only one item in your list list, how do you view this situation? I personally feel that the webpage path (bread crumbs) should be displayed in a row.
3. Button to Input I can't remember when the last time I used input type=submit, but I didn't use it like this a long time ago. There are two reasons: why the button element must enter type=submit, and the botton is its own element. In the code, the botton is easy to identify and it is easy to define with css (not all old versions of browsers support this element tag attribute). And it also allows us to write other tag elements inside it, thus extending our possibility of plasticity for it.<button type=submit>Submit Form</button>4. Leave a message: Ordered list (ol) For unordered list (ul) The list list is really great! There are 3 different types (ordered, unordered and defined lists) that each have its own uses. Maybe you have some doubts about when to use ordered lists (ol) and when to use unordered lists (ul) because they make sense when to use them. Leaving a message is a bit like an example in textbooks that are arranged neatly in order of time, sorting upwards naturally. Each comment corresponds to a fixed time, so the comment structure should be in an ordered list (ol).
<ol><li><ul><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>Comment text goes here...</div></li></ol>5. label/input: div for other label elements Inlay the parent structure outside label/input, which label element is the best choice?
<label for=contactName>Your Name</label><input type=text name=contactName id=contactName />
Using the appropriate tag code was previously possible, but now I still chose to use div to mosaic label/input, label and associated label are regarded as a whole. The div element has a wide range of semantic characteristics, and it can adapt to any situation.
<div><label for=contactName>Your Name</label><input type=text name=contactName id=contactName /></div>Original Chinese: My 5 HTML writing preferences Original English: My Top 5 HTML Coding Preferences