Good HTML has four elements DOCTYPE html head body
The DOCTYPE declaration This DOCTYPE says to draw the page normally<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">! Heres the one for HTML5<!DOCTYPE html>!
The <p> tag is for text only <p> … </p> Creates a line break before and after
<br /> creates a line break It is a singleton tag<p>!Kreese: Sweep the leg.<br />![Johnny stares at him in shock]<br />!Kreese: Do you have a problem with that?<br />!Johnny Lawrence: No, Sensei. <br />!Kreese: No mercy. !</p>!
The anchor tag allows hyperlinking Allows linking from section to section and page to page. Link to another page:<a href=http://www.othersite.com/>Go to othersite</a>! Link to someplace on this page:<a href="#aParagraph">Go to another paragraph.</a>! … and …<a name="aParagraph"></a>! Email link:<a href=mailto:email@example.com>Email Rap</a>!
Add images with <img> Inserts an image.<img src="logo.jpg" />! Formats allowed: jpg, gif, png Can specify sizes and alternate texts:<img src="logo.jpg" alt="Company logo"height="52px" width="100px" />! alttext for missing/jank images and vision- impaired surfers Can make it a link, too:<a href="tic.com"><img src="logo.jpg" /></a>!
There are many other tags for layouts Well get to these in a few chapters. div span nav article aside header footer hgroup time mark
Conclusion The basic layout of a page contains exactly one each of a DOCTYPE declaration, a html tag, a head tag, and a body tag Youll also need paragraph tags to wrap text, line breaks, and probably anchor tags