CS174
Chris Pollett
Aug 31, 2016
On Monday, we introduced HTTP, the protocol above TCP/IP for retrieving hypertext documents. I.e., web pages. We now describe the language used to make web pages: HTML.
ISO HTML (HTML 4.01) which is specified using SGML a XHTML 1.0 Transitional XHTML 1.0 STRICT XHTML 1.1 HTML 5/XHTML 5
<img src="my_picture.png" ></img> <!-- this is okay in an XHTML document (not in HTML 5). BTW, this is an example HTML comment --> <img src="my_picture.png" /> <!--this is okay for both XHTML and HTML 5 and is an abbreviation for the line above --> <img src="my_picture.png" > <!--okay only in HTML 5, but don't use for this class --> <P>old style paragraph</P> <!--okay only in HTML 5, but don't use for this class --> <p><i>Hello</i></p> <!--okay --> <p><i>Hello</p></i> <!--not okay -->Open tags may have attributes. For example, src in the image tag above. The value of an attribute must be given in double quotes or single quotes for XHTML. Quotes are optional for HTML 5.
XML declarations:
<?xml version ="1.0" encoding="utf-8" ?> <!-- as not supported by some old browsers validators doesn't usually check this -->
SGML DOCTYPE. This says which Document Type Definition will be used:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
The XHTML document:
<html xmlns="http://www.w3.org/1999/xhtml" > <!-- might have namespaces for other things like SVG --> <head> <title>name of my document</title></head> <body><!--actually page stuff--></body> </html>
<!DOCTYPE html> <html> <head> <title>Simple HTML</title> <meta charset="utf-8" /> </head> <body> <h1>Example HTML 5 document.</h1> <p>Example paragraph.</p> </body> </html>