TTh, CLA 4-27
1:00 PM -2:50 PM
CRN 71857

 

Valid XHTML 1.0!

Valid CSS!

CIS 421Projects › Project 1

XHTML Syntax rules

What is XHTML & Why use it?

XHTML is well-formed HTML

–For now, that means:


XHTML Example

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Declaration references transitional.dtd for XHTML on W3C web site
DTD=Document Type Definition

Three types of XHTML:

Comment tags within HTML files

<! -- this comment will not display -- >
<! – This comment can go on for
several lines,
written by L. Soe, September 23, 2005
-- >

Good idea to comment your HTML pages – required in your tutorial cases

When you come back later, you can see who did what, when

The Structure of an HTML File that is Valid XHTML contains

  • One root element: <html> marks the start of an HTML document
  • the closing </html> tag tells a browser when it has reached the end of that HTML document.
  • HTML document divided into
    • <head> element – info about document, including title which displays in browser
    • <body> element contains everything else that displays on page + code + display directions

XHTML template page

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XHTML template</title>
</head>
<body>

<h1>header</h1>
<p>
<script language="JavaScript" type="text/javascript"><!-- hide from old browsers
document.write(" Last updated " + document.lastModified + ".")
// end script hiding -->
</script>
</p>
</body>
</html>