Skip to main content

Posts

HTML5 Features - No More Types for Scripts and Links

4. No More Types for Scripts and Links You possibly still add the type attribute to your link and script tags. < link   rel = "stylesheet"   href = "path/to/stylesheet.css"   type = "text/css"   />    < script   type = "text/javascript"   src = "path/to/script.js" > </ script >    This is no longer necessary. It’s implied that both of these tags refer to stylesheets and scripts, respectively. As such, we can remove the type attribute all together. < link   rel = "stylesheet"   href = "path/to/stylesheet.css"   />    < script   src = "path/to/script.js" > </ script >  

HTML5 Features - Redefined

3. <small> Redefined Not long ago, I utilized the <small> element to create subheadings that are closely related to the logo. It’s a useful presentational element; however, now, that would be an incorrect usage. The small element has been redefined, more appropriately, to refer to small print. Imagine a copyright statement in the footer of your site; according to the new HTML5 definition of this element; the <small> would be the correct wrapper for this information. The small element now refers to “small print.”

HTML5 Features - The Figure Element

2. The Figure Element Consider the following mark-up for an image: < img   src = "path/to/image"   alt = "About image"   />    < p > Image of Mars.  </ p >    There unfortunately isn’t any easy or semantic way to associate the caption, wrapped in a paragraph tag, with the image element itself. HTML5 rectifies this, with the introduction of the <figure> element. When combined with the <figcaption> element, we can now semantically associate captions with their image counterparts. < figure >         < img   src = "path/to/image"   alt = "About image"   />         < figcaption >             < p > This is an image of something interesting.  </ p >         </ figcaption >    </ figure >