html and xhtmls290179663.websitehome.co.uk/.../05/html-handouts.pdf · html version year status -...

23
Presentation HTML and XHTML Version Year Status - 1993 IETF working draft http://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt HTML <HTML></HTML> encloses the entire document and defines it as HTML <HEAD></HEAD> comes after the opening <HTML> tag and contains the <TITLE> <TITLE></TITLE> contains the name of the document and must be enclosed by <HEAD> tags <BODY></BODY> contains all of the rest of the document - it is opened after the closing </HEAD> tag and is closed at the end of the document. The only tag to go after the closing </BODY> tag is the closing </HTML> tag. A - anchor ADDRESS - formatting tag, often shown in italics B - formatting tag, bold BASE - optional head element, sets base URL for related documents BLOCKQUOTE - formatting tag, to indicate portions of text included from other documents BR - line break CITE - formatting tag, to indicate text is a citation from another source CODE - formatting tag, to indicate text is program source code DD - list tag, definition DIR - list tag, directory DL - list tag, definition list DT - list tag, definition term EM - formatting tag, to indicate text is to be emphasized

Upload: others

Post on 19-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Presentation

HTML and XHTML

Version Year Status- 1993 IETF working draft

http://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt

HTML

<HTML></HTML> encloses the entire document and defines it as HTML<HEAD></HEAD> comes after the opening <HTML> tag and contains the <TITLE><TITLE></TITLE> contains the name of the document and must be enclosed by <HEAD> tags<BODY></BODY> contains all of the rest of the document - it is opened after the closing </HEAD> tag and is closed at the end of the document. The only tag to go afterthe closing </BODY> tag is the closing </HTML> tag.

A - anchorADDRESS - formatting tag, often shown in italicsB - formatting tag, boldBASE - optional head element, sets base URL for related documentsBLOCKQUOTE - formatting tag, to indicate portions of text included from other documentsBR - line breakCITE - formatting tag, to indicate text is a citation from another sourceCODE - formatting tag, to indicate text is program source codeDD - list tag, definitionDIR - list tag, directoryDL - list tag, definition listDT - list tag, definition termEM - formatting tag, to indicate text is to be emphasized

Page 2: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

H1 - structural heading, top (largest) levelH2 - structural headingH3 - structural headingH4 - structural headingH5 - structural headingH6 - structural heading, bottom (smallest) levelHR - horizontal ruleI - formatting tag, italicsIMG - image anchorISINDEX - optional head element, indicates document is a searchable indexKBD - formatting tag, indicates expected user in source codeLI - list tag, list itemLINK - indicates relationship between documents, varies from browser to browserMENU - list tag, compactedMETA - optional head element, information for client software such as last revision dateNEXTID - optional head element used by automated markup systems to keep track of anchorsOL - list tag, ordered listP - paragraph breakPRE - formatting tag, indicates text should be preformatted (monospaced, preserve whitespace)SAMP - formatting tag, used to mark text output from a computer programSTRONG - formatting tag, strongly emphasize textTT - formatting tag, typewriter text, show text in fixed fontUL - list tag, unnumbered listVAR - formatting tag, indicated a variable in program source code

Page 3: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

HTML

Version Year Status- 1993 IETF working draft

2.0 1995 IETF RFCs

Various RFCs: 1866, 1867, 1942, 1980, 2070

tables, image maps, internationalisation

3.0 April 1995 Proposed by Dave Raggett / W3C

Style sheet links, tables, text flow and maths symbols

Netscape Navigator

Internet Explorer

v1 July 1995v2 November 1995v3 August 1996v4 September 1997v5 March 1999v6 August 2001v7 October 2006

Example IE only tags

<bgsound />This tag will set a sound file to play in the background as the Web page is displayed.

<marquee></marquee>With the <marquee></marquee> tag, you can create a scrolling text marquee on your Web page. This tag is also supported by MSNTV.

Page 4: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Example Netscape only tags

<blink></blink>The text within the <blink></blink> tag will turn on and off (blink).

<keygen></keygen>This tag was meant to generate a public key to encrypt HTML forms and make them secure

<layer></layer>The layer tag allows you to place sections of your Web page on different "layers" and treat them as separate objects within your page.

<multicol></multicol>The enclosed text will be displayed in multiple columns.

<nolayer></nolayer>The <nolayer></nolayer> tag indicates HTML that should be displayed in browsers that don't support the <layer></layer> tag

HTML

Version Year Status- 1993 IETF working draft

2.0 1995 IETF RFCs

3.0 April 1995 Proposed by Dave Raggett / W3C

3.2 Jan 1997 W3C Recommendation

Drops many of the 3.0 features, but includes vendor specific tags

Start with some html

<h1>Flash drives</h1>

<h2>Flash drive capacities</h2>

<p>Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.</p>

<img src=”memoryusb.jpg” />

<h2>Current capacities</h2>

<p>Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.</p>

Lets make it more “colourful” in Frontpage

Page 5: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

<body bgcolor="#FFFFFF" text="#000080">

<h1 align="center"><font color="#408080" size="6" face="Tunga">Flashdrives</font></h1>

<h2 align="right"><font color="#FF0000" face="Impact">Flash <blink>drive</blink>

capacities</font></h2>

<blockquote> <p><font face="Arial Narrow">Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.</font></p></blockquote>

<p align="center"><img src="memoryusb.jpg" width="50%"height="50%" /> </p>

<h2 align="center"><font color="#800040" face="Comic Sans MS">Currentcapacities</font></h2>

<blockquote> <p><font face="Arial Narrow">Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.</font></p>

</blockquote></body>

Lost the content ...

<body bgcolor="#FFFFFF" text="#000080">

<h1 align="center"><font color="#408080" size="6" face="Tunga">Flashdrives</font></h1>

<h2 align="right"><font color="#FF0000" face="Impact">Flash <blink>drive</blink>

capacities</font></h2>

<blockquote> <p><font face="Arial Narrow">Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.</font></p></blockquote>

<p align="center"><img src="memoryusb.jpg" width="50%"height="50%" /> </p>

<h2 align="center"><font color="#800040" face="Comic Sans MS">Currentcapacities</font></h2>

<blockquote> <p><font face="Arial Narrow">Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.</font></p>

</blockquote></body>

... in with the ‘style’ or design

Page 6: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Also

• What happens when the same content is to beused in different ways...

...displayed in different styles

Print

• Typically B&W

• Headers & Footers

• Page numbers

PDAs / Mobile devices

• Smaller screen• May not support

full range of colours or fonts

Page 7: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Readers for visual impairments

• Enlarges text

• May discard pictures

• May read the page aloud

HTML

Version Year Status- 1993 IETF working draft

2.0 1995 IETF RFCs

3.0 April 1995 Proposed by Dave Raggett / W3C

3.2 Jan 1997 W3C Recommendation

4.0 Dec 1997 W3C Recommendation

Offers “flavours” of HTML - adds, cleans and deprecates features

HTML 4.0

Marks some elements and attributes as deprecated

Strict Deprecated features forbidden

Transitional Deprecated features allowed

Frameset Frames are allowed

Page 8: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

HTML 4.0 - Doctypes

Semantic HTML and CSS

Use HTML to describe the content and structure of the document

Use CSS to describe the presentation

Page 9: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Semantic HTML

• No official specification

• NOT presentation (style) or how conveyed

Semanticadj.Of or relating to meaning, especially meaning in language.

Of, relating to, or according to the science of semantics.

• Use HTML to convey the meaning of the document (content)

Semantic HTML

• Avoid presentation markup

<h1>, <h2>, ..<h6><p>, <li><em>, <strong><blockquote>, <cite>

<font color="..., align="center"...<font ...face="...<blink>bgcolor="#FFFFFF" text="#000080"<hr>, <i>, <b>,<br>,<ul>... etc..

Good Bad

<em> instead of <i><strong> instead of <b>

Marking up example

Page 10: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Raw design (text)...

Flash drives

Flash drive capacities

Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.

Include image here

Current capacities

Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.

<h1>Flash drives</h1>

<h2>Flash drive capacities</h2>

<p>Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.</p>

<img src=”memoryusb.jpg” />

<h2>Current capacities</h2>

<p>Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.</p>

Added semantic markup...

So we end up with this:

Page 11: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

And NOT this:

<html><head><title><b>Flash drive</b></title>

<body><b><p>Flash drives</p></b>

<p><i>Flash drive capacities</i></p>

<p>Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.</p><img src="memoryusb.jpg" /></img>

<p><i>Current capacities</p>

Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.</p>

</html>

Which comes from this mess:

No other tags allowed in titlesMissing </head>Attempting to use other tags rather than <h1>

<html><head><title><b>Flash drive</b></title>

<body><b><p>Flash drives</p></b>

<p><i>Flash drive capacities</i></p>

<p>Here is a picture of a 128MB flash drive which was popular at one time. Note the USB connector. 128MB is regarded as being rather small now.</p><img src="memoryusb.jpg" /></img>

<p><i>Current capacities</p>

Current standards are measured in Gigabytes (1GB, 2GB) with increasingly larger sized devices scheduled to appear soon.</p>

</html>

Which comes from this mess:

Attempting to use other tags rather than <h2>

Image tag not properly closedMissing <h2>

Missing <p>Missing </body>

Page 12: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Other things to avoid

<br> tags to create lines

Do NOT use tables for page layout - not semantic

Tables are usually more bytes of markup

Longer to download, and more traffic for the host

Tables are usually slower to layout for the browser/can’t do

incremental rendering

Takes longer for the user to see anything on the page

Tables may require you to chop single, logical images into multiple

ones

Redesign very difficult and also increases page load time

Tables break text copying on some browsers

Annoying to the user

Break screen readers

Microsoft home page from 2006

Page 13: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

HTML

Version Year Status- 1993 IETF working draft

2.0 1995 IETF RFCs

3.0 April 1995 Proposed by Dave Raggett / W3C

3.2 Jan 1997 W3C Recommendation

4.0 Dec 1997 W3C Recommendation

4.1 Dec 1999 W3C Recommendation

4.1: Tweaks, fixes and eventually ISO - standardisation

Page 14: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Version Year Status- 1993 IETF working draft

2.0 1995 IETF RFCs

3.0 April 1995 Proposed by Dave Raggett / W3C

3.2 Jan 1997 W3C Recommendation

4.0 Dec 1997 W3C Recommendation

4.1 Dec 1999 W3C Recommendation

1.0 Jan 2000 W3C Recommendation

XHTML

XHTML 1.0

XML syntax rules have to be followed

Strict Same as HTML 4.0 Strict

Transitional Same as HTML 4.0 Transitional

Frameset Same as HTML 4.0 Frameset

Tags must be in lower case

End tags cannot be omitted

Empty elements must close properly so<image src = “myimage.png” >

<TITLE>My title </TITLE>

<p>Most tags have an end tag that’s requiredso don’t forget your end tag

<title>My title </title>

</p>

/>

Page 15: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Tags must be correctly nested

Attribute values must be in quotes

<b>Example text in boldwith <i>incorrect</b> nesting </i>

<img src=“correctly_quoted.jpg” />

XHTML

Version Year Status- 1993 IETF working draft

2.0 1995 IETF RFCs

3.0 April 1995 Proposed by Dave Raggett / W3C

3.2 Jan 1997 W3C Recommendation

4.0 Dec 1997 W3C Recommendation

4.1 Dec 1999 W3C Recommendation

1.0 Jan 2000 W3C Recommendation

1.1 May 2001 W3C Recommendation

XHTML 1.1

Reformulates the standard into a set of modules

Strict Same as HTML 4.0 Strict

Adds more international language support

All presentation done through CSS

Page 16: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Cascading Style Sheets

CSS level 117 Dec 1996, revised 11 Jan

1999http://www.w3.org/TR/REC-

CSS1

CSS level 212-May-1998, revision

Candidate recommendation on 2.1, July 2007

http://www.w3.org/TR/REC-CSS2/

http://www.w3.org/TR/CSS21/

CSS level 3 Working draft documentshttp://www.w3.org/Style/CSS/

current-work

Variable browser support for different levels

http://www.webdevout.net/browser_support.php

Final transformed document

Content

Design+

A style sheet

Final transformed document

Content

Design+

A different style sheet

Page 17: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Semantic HTML example

Example

http://business.kingston.ac.uk

<!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>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Faculty of Business and Law</title>

<link href="images/csslp.css" rel="stylesheet" media="screen" type="text/css"><link rel="alternate" type="application/rss+xml" href="http://bustech2.kingston.ac.uk/rss.php" title="Faculty of Business and Law (Kingston University) - News Feed"><link rel="alternate" type="application/rss+xml" href="http://bustech2.kingston.ac.uk/rss_events.php" title="Faculty of Business and Law (Kingston University) - Events Feed"><style type="text/css"><!--.style9 { font-size: 11px; color: #FFFFFF; font-family: Verdana;}.news_line { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee;}.style23 { font-family: Verdana; font-size: 12px;}.style29 { color: #2E5B9A; font-weight: bold;}.style38 {border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #eeeeee; font-family: Verdana; font-size: 11px; }.style41 {color: #FFFFFF}.contentcenter_bottom{ width:966px; position:absolute; height: 20px; margin: 0 auto; margin-top: -20px; bottom:0px;}

--></style>

Page 18: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

<style type="text/css"><!--body,td,th { font-family: Lucida Grand, Verdana, Helvetica; font-size: 12px;}#navlist{ text-decoration: none; background-color:#FFFFFF; color:#FFFFFF; width:160px; }#navlist_sub{ text-decoration: none; background-color:#FFFFFF; color:#0000CC; }#navlist_nonact{ text-decoration: none; background-color:#9EAFCB; padding:3px; margin-bottom:1px; }#navlist_act{ text-decoration: none; background-color:#1F5496; padding:3px;

margin-bottom:1px; }#sublist_act{ text-decoration: none; background-color:#F7F7F7; padding-left:4px; margin-bottom:1px; }#navitem{ border-bottom:#BBBBBB 1px dotted; padding:3px; padding-left:4px; font-size:11px;}#navsubitem{ padding:2px; font-size:11px;}--></style></head><body>

<div id="container"> <div id="header"> </div> <div id="content"> <div id="banner" style="height: 145px;"> <img src="images/logo_index.jpg" alt="logo" usemap="#banner" border="0" height="135" width="966"> <map name="banner" id="banner"><area shape="rect" coords="25,28,402,66" href="http://www.kingston.ac.uk/" alt="Kingston University Website"><area shape="rect" coords="25,69,332,105" href="http://business.kingston.ac.uk/" alt="Business and Law Home Page"> </map> </div>

<div id="left_col"><div id="navlist"> <div id="navlist_act"><a href="http://bustech2.kingston.ac.uk/index.php"><span style="color: rgb(255, 255, 255);">Home</span></a></div> <div id="navlist_sub"> <div id="navitem"> <a href="http://bustech2.kingston.ac.uk/flavor2.php?id=320">Kingston Business School</a> </div> <div id="navitem"> <a href="http://bustech2.kingston.ac.uk/flavor2.php?id=342">Kingston Law School</a> </div> <div id="navitem"> <a href="http://bustech2.kingston.ac.uk/flavor2.php?id=295">Dean’s Welcome</a> </div> <div id="navitem"> <a href="http://bustech2.kingston.ac.uk/news.php">News</a> </div> <div id="navitem"> <a href="http://bustech2.kingston.ac.uk/flavor2.php?id=293">Contact</a> </div> <div id="navitem"> <a href="http://bustech2.kingston.ac.uk/flavor2.php?id=294">Location</a> </div>

</div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/events.php"><span style="color: rgb(255, 255, 255);">Seminars and Events</span></a></div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/flavor2.php?id=378"><span style="color: rgb(255, 255, 255);">Courses</span></a></div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/flavor2.php?id=323"><span style="color: rgb(255, 255, 255);">Alumni</span></a></div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/flavor2.php?id=319"><span style="color: rgb(255, 255, 255);">Departments and Staff</span></a></div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/flavor2.php?id=351"><span style="color: rgb(255, 255, 255);">Research</span></a></div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/flavor2.php?id=327"><span style="color: rgb(255, 255, 255);">Services for Business</span></a></div> <div id="navlist_nonact"><a href="http://bustech2.kingston.ac.uk/flavor2.php?id=321"><span style="color: rgb(255, 255, 255);">International</span></a></div>

Page 19: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

<div id="middle_col2"> <span class="Heading_title">Welcome</span> <p style="font-family: Lucida Grande,verdana; line-height: 19px; font-size: 12px;" align="justify">TheFaculty of Business and Law was established in 1984 combining theSchool of Business and School of Law, which can both trace their rootsback to the 60s. Currently it has more than 5,000 students enrolled onover 30 undergraduate and postgraduate programmes delivered on either apart-time or full-time basis. <br> <br> Our aim is to provide a modern, stimulating business education, balanced between academic theory and practical applications. Graduates from Kingston University are recognised as top-quality, marketable professionals. <br> </p> <br>

<span class="Heading_1_orange" style="font-family: Lucida Grande,verdana; line-height: 19px; font-size: 12px;"><strong>Latest news</strong></span><span class="Heading_1_orange"><strong>:</strong></span> <a href="http://bustech2.kingston.ac.uk/rss.php"><img src="images/feed.gif" alt="Rss feed" border="0" height="16" width="16"></a><br> <table border="0" cellpadding="3" cellspacing="0" width="98%"> <tbody><tr> <td><img src="images/report.gif" alt="news_icon"></td> <td class="news_line style31 style23"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=82"><span class="Heading_1">Kingston law graduate appointed President of the Surrey Law Society ...</span></a><br> <span class="style39">Surrey Law Society (SLS) has appointed Keith ...<span class="bodytext_small"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=82">Read more</a></span></span></td> <td class="style38" valign="top" width="145"><div class="bodytext_small" align="right">22 Jan 2008 - 11:04:00</div></td> </tr> <tr> <td><img src="images/report.gif" alt="news_icon"></td> <td class="news_line style31 style23"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=81"><span class="Heading_1">Law students in European regional final ...</span></a><br> <span class="style39">A team from Kingston Law School comprising Level 6 ...<span class="bodytext_small"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=81">Read more</a></span></span></td> <td class="style38" valign="top" width="145"><div class="bodytext_small" align="right">21 Jan 2008 - 10:58:00</div></td> </tr> <tr> <td><img src="images/report.gif" alt="news_icon"></td>

<td class="news_line style31 style23"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=80"><span class="Heading_1">Place in national final for BA Business Management student ...</span></a><br> <span class="style39">Ronald Katamba beat eight other students in a ...<span class="bodytext_small"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=80">Read more</a></span></span></td> <td class="style38" valign="top" width="145"><div class="bodytext_small" align="right">11 Jan 2008 - 10:09:00</div></td> </tr> <tr> <td><img src="images/report.gif" alt="news_icon"></td> <td class="news_line style31 style23"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=79"><span class="Heading_1">Deutsche Bank aided by BIT student project ...</span></a><br> <span class="style39">Students studying on the BSc (Hons) Business ...<span class="bodytext_small"><a href="http://bustech2.kingston.ac.uk/news_item.php?id=79">Read more</a></span></span></td> <td class="style38" valign="top" width="145"><div class="bodytext_small" align="right">07 Jan 2008 - 11:28:00</div></td> </tr> <tr valign="top"> <td style="font-family: Verdana; font-size: 11px;" colspan="3"><div align="right"><a href="http://bustech2.kingston.ac.uk/news.php">More</a></div></td> </tr> </tbody></table> </div>

<div id="right_col"> <form id="search" name="search" method="post" action="search.php"> <table style="background-image: url(images/search_back.jpg); background-repeat: no-repeat; background-position: center top;" border="0" cellpadding="2" cellspacing="0" width="100%"> <tbody><tr> <td colspan="2"><span class="style9"><span class="style41"><strong>Search Business &amp; Law:</strong></span></span></td> </tr> <tr> <td colspan="2"><input id="searchterm" name="searchterm" type="text"></td> </tr> <tr> <td colspan="2"><div align="right"> <input name="Submit2" value="Search" type="submit"> </div></td> </tr> </tbody></table> </form> <div align="center"> <p><br> <img src="images/amba_ac.jpg" alt="AMBA" height="54" width="160"><br> </p> <p><br> <img src="images/cim_ac.jpg" alt="CIM" height="60" width="160"></p> <p><br> <img src="images/cipd.gif" alt="CIPD" height="74" width="74"><br> <br> </p> </div> </div>

<div class="contentcenter_bottom" align="center"> © <a href="http://www.kingston.ac.uk/copyright/index.htm">Kingston University</a> | <a href="http://www.kingston.ac.uk/disclaimer/index.htm">Disclaimer</a> | <a href="http://www.kingston.ac.uk/">Kingston University Web site</a>&nbsp; </div> </div></div><script src="images/urchin.js" type="text/javascript">

</script>

<script type="text/javascript">

_uacct = "UA-930382-3";

urchinTracker();

</script></body></html>

Page 20: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

Step Action

1 Strip all presentation out

2 Only keep / apply semantic HTML

3 Mark out logical content blocks (div and span)

Exercise• Cross out all CSS that shouldn’t be in the

source

• Use semantic HTML to convey the meaning of the document

Page 21: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

div

• markup logical shapes in the document

<div id="name"> .....

</div>

span

• markup logical shapes inside another element

here is some example text with an important <span id="note"> note that may be styled in a different way </> to the rest of the document.

Page 22: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

header

leftmenu main rightmenu

footer

Semantic names

• Avoid presentation/location based names

branding, search, links, navigation, news, content, subcontent, badges, siteinfo

header, footer, leftcolumn, rightcolumn, main ...

Good Bad

Page 23: HTML and XHTMLs290179663.websitehome.co.uk/.../05/HTML-handouts.pdf · HTML Version Year Status - 1993 IETF working draft 2.0 1995 IETF RFCs 3.0 April 1995 Proposed by Dave Raggett

branding

navigation contentMain contentSub

siteInfo

branding

navigation contentMain contentSub

siteInfo

news

searchInput

badges