The code tag and the pre tag.


Originally from http://kiri.dmt-uts.net

I didn't realise the <code> tag was on the way out, but when I tried to validate the use of <code> within <pre> tags, or vice versa, the W3C XHTML 1.0 Strict Validator didn't seem to like this. This, however, seems to be fine in HTML5 and used for backwards compatibility.

I've been told that the <code> tag has been deprecated, though I haven't seen anything about it yet in reading! W3Schools doesn't think it is either - curious!

References       StackOverflow 2012, Why does HTML5 recommend putting the code element inside pre?, viewed 5 June 2013, <http://stackoverflow.com/questions/11742907/why-does-html5-recommend-putting-the-code-element-inside-pre>.       W3C 2013, 4.6.11 The code element, viewed 5 June 2013, <http://www.w3.org/TR/2011/WD-html5-author-20110809/the-code-element.html>.