4.0 HTML Code Snippets
When writing web pages, and especially when first starting out, it is sometimes useful to be able to lay your hands on some quick snippets of code that you can pull into your pages and alter (although with practice some of these become second nature anyway).
HTML Document - General Layout including DOCTYPE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>Title goes here</title> <meta name="description" content="Description of page" /> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <p>Content goes here<p> </body> </html>
Links
<a href=" " title=" "> </a> <a href="mailto: "> </a>
Images
<img src=" " alt=" " title=" " />
3 column page with header and footer
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>Title goes here</title> <meta name="description" content="Description of page" /> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="wrap"> <div id="header"> </div> <div id="content"> </div> <div id="rightbox"> </div> <div id="leftbox"> </div> <div id="footer"> </div> </div> </body>