Hidden features of HTML
Solution 1:
Using a protocol-independent absolute path:
<img src="//domain.com/img/logo.png"/>
If the browser is viewing an page in SSL through HTTPS, then it'll request that asset with the https protocol, otherwise it'll request it with HTTP.
This prevents that awful "This Page Contains Both Secure and Non-Secure Items" error message in IE, keeping all your asset requests within the same protocol.
Caveat: When used on a <link> or @import for a stylesheet, IE7 and IE8 download the file twice. All other uses, however, are just fine.
Solution 2:
The label tag logically links the label with the form element using the "for" attribute. Most browsers turn this into a link which activates the related form element.
<label for="fiscalYear">Fiscal Year</label>
<input name="fiscalYear" type="text" id="fiscalYear"/>
Solution 3:
The contentEditable property for (IE, Firefox, and Safari)
<table>
<tr>
<td><div contenteditable="true">This text can be edited<div></td>
<td><div contenteditable="true">This text can be edited<div></td>
</tr>
</table>
This will make the cells editable! Go ahead, try it if you don't believe me.
Solution 4:
I think the optgroup tag is one feature that people don't use very often. Most people I speak to don't tend to realise that it exists.
Example:
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Solution 5:
My favourite bit is the base tag, which is a life saver if you want to use routing or URL rewriting...
Let's say you are located at:
www.anypage.com/folder/subfolder/
The following is code and results for links from this page.
Regular Anchor:
<a href="test.html">Click here</a>
Leads to
www.anypage.com/folder/subfolder/test.html
Now if you add base tag
<base href="http://www.anypage.com/" />
<a href="test.html">Click here</a>
The anchor now leads to:
www.anypage.com/test.html