Frontend Engineering, Volume I

Example 2c, Monospaced (Mostly) Elements

In Notepad++:

<!DOCTYPE html>

<html>

	<head>


	</head>

	<body>

<p>This is a <code title='code'>code</code> element.</p>
<p>This is a <kbd title='kbd'>kbd</kbd> element.</p>
<p>This is a <samp title='samp'>samp</samp> element.</p>
<p>This is a <var title='var'>var</var> element.</p>

	</body>

</html>

In your browser (use these to check the tooltips):

This is a code element.

This is a kbd element.

This is a samp element.

This is a var element.

In Opera, that var is in italics. The <code> element is redefined, in our website, to have a green background.

© 2012, Martin Rinehart


Feedback: MartinRinehart at gmail dot com

# # #