180 likes | 197 Views
ICPMM65DA Create Web Pages With Multimedia Week 2. Gareth Jay BSc (Multimedia Information Systems). Email Address: garethjay@iinet.net.au. Last Week. Identify the tools and parameters of web page design Produce web pages Validate and prepare for distribution. Last Week.
E N D
Gareth JayBSc (Multimedia Information Systems) Email Address: garethjay@iinet.net.au
Last Week • Identify the tools and parameters of web page design • Produce web pages • Validate and prepare for distribution
Last Week • XHTML – eXtensible HyperText Markup Language • Tags must be properly nested • Tags must be closed • Tags must be lowercase • Documents must have one root element
Last Week • CSS – Cascading Style Sheets • Internal, External, Inline • Defines the style of HTML tags • element{ property1: value; property2: value;}
XHTML • Some other syntax differences: • Attribute names must be lowercase • Attribute values must be quoted • Attribute minimization is forbidden • The id attribute replaces the name attribute • The XHTML DTD defines mandatory elements
Attribute names must be lowercase • This is wrong: <table WIDTH="100%"> • This is correct: <table width="100%">
Attribute values must be quoted • This is wrong: <table width=100%> • This is correct: <table width="100%">
Attribute minimization is forbidden • This is wrong: <input checked><input readonly><input disabled><option selected><frame noresize> • This is correct: <input checked="checked" /><input readonly="readonly" /><input disabled="disabled" /><option selected="selected" /><frame noresize="noresize" />
The XHTML DTD defines mandatory fields • All XHTML documents must have a DOCTYPE declaration. The html, head, title, and body elements must be present. • This is an XHTML document with a minimum of required tags: <!DOCTYPE Doctype goes here><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Title goes here</title></head><body></body></html>
Document Type Definitions • A DTD specifies the syntax of a web page in SGML • DTDs are used by SGML applications, such as HTML, to specify rules for documents of a particular type, including a set of elements and entity declarations • An XHTML DTD describes in precise, computer-readable language, the allowed syntax of XHTML markup • There are three XHTML DTDs: • STRICT • TRANSITIONAL • FRAMESET
Document Type Definitions • XHTML 1.0 Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Use the strict DOCTYPE when you want really clean markup, free of presentational clutter. Use it together with CSS.
Document Type Definitions • XHTML 1.0 Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Use the transitional DOCTYPE when you want to still use HTML's presentational features.
Document Type Definitions • XHTML 1.0 Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> Use the frameset DOCTYPE when you want to use HTML frames.
Document Type Definitions • The DOCTYPE declaration is always the first line in an XHTML document!
Document Type Definitions • Your assignments require you to use XHTML 1.0 Strict: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Validating your XHTML • Go to http://validator.w3.org
Assignment 1 • See html file