HTML5 – The code element

As a techie, I often want to post excerpts of code on a webpage. Generally in publishing code fragments are printed in a monotype font to distinguish from the main body of text and also to more closely resemble how the code appears in the IDE. The <code> element is used in this way to highlight content that is a code fragment. Here’s a quick example both as the text and then in use: Use the JQuery <code> click() </code> function to bind an event handler to the javascript click event to perform an action when the user mouse clicks Read More

HTML5 – The small element

<small> is in the ‘4.6 Text-level semantics’ section of the WHAT-WG HTML living standard. <small> one used to mean just that: small font. It is now one of a set of elements that has been re-imagined in a more semantic light. <small> now has a very distinct meaning – it now represents ‘side comments such as small print’. This also would cover disclaimers, copyright notices and the like. <small> is a text level element, so is expected to be used within a block of text such as a paragraph, and not as a block of text. So small print such Read More