lis650 lecture 3 minor html thomas krichel 2004-02-20

58
LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Upload: lucas-craig

Post on 27-Mar-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

LIS650 lecture 3Minor HTML

Thomas Krichel

2004-02-20

Page 2: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

today we have fun with

• minor HTML– tables– other HTML feature(s)

• minor points on line breaking

– reexamining our <head>

• Nielsen on page design, part II

Page 3: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Tables

• HTML allows to align contents is tabular form.• Tables may have a caption and/or a summary.

– Both describe the table.– The latter is longer than the former.

• Table rows are aligned vertically.• Table columns are aligned horizontally.• Cells are at the intersection between rows and

columns.

Page 4: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

table illustration

A table is a matrix formed by the intersection of a number of horizontal rows and vertical columns.

Column 1 Column 2 Column 3

Row 1

Row 2

Row 3 CellCellCell

CellCellCell

CellCellCell

Page 5: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

HTML table design

• it tries to make simple things simple without making sophisticated things impossible

• it takes account of the fact that the absolute width of the table can not be controlled by the HTML writer but it is the hands of the reader.

• Not all things one would like to do are supported.• Sometimes tables can lead to excessive scrolling. Use of

style sheets is recommended when the table has mainly a visual function, see Thomas' homepage for a bad example.

Page 6: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

tags and attributes that I don't cover

• many points in the table spec of HTML have one or more of the following attributes– mainly important for non-visual rendering– complicate & abstract– little used– mainly a verbosity reduction feature

• so I am omitting some of them in the discussion

Page 7: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

more table talk

• table rows may be grouped into– head section– body section– foot section

• table columns may also be grouped into more arbitrary ways.

• table cells can contain– header information– table data

Page 8: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <table> tag

• encloses a table. takes i18n and core attributes.• The "summary" attribute provides a summary of

the table's purpose and structure for user agents rendering to non-visual media such as speech and Braille.

• The "width" attribute specifies the desired width of the entire table and is intended for visual user agents. When the value is a percentage value, the value is relative to the user agent's available horizontal space.

Page 9: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the "frame" attribute of <table>

• This attribute specifies which sides of the frame surrounding a table will be visible. Possible values: – void no sides. This is the default value. – above the top side only – below the bottom side only – hsides the top and bottom sides only – vsides the right and left sides only – lhs the left-hand side only– rhs the right-hand side only – box all four sides– borderall four sides

Page 10: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the "rules" attribute of <table>

• This attribute specifies which rules will appear between cells within a table. Possible values – none no rules. This is the default. – groups rules between row groups only. – rows rules between rows only. – cols rules between columns only. – all rules between all rows and columns

Page 11: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the "border" attribute of <table>

• This attribute sets the width of the frame of a table, if it is set to be visible.

• Rules and frames can make for visual noise.

Page 12: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <caption> tag

• It is used to give a caption to the table. • It takes the i18n and the core attributes.• It is only allowed immediately after the <table>

tag start.• There can only be one <caption> in any one

<table>.• We will now study the alignment attributes. This

is an attribute group widely used in tables. <table> also takes those attributes.

Page 13: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

alignment: the "align" attribute• The "align" attribute specifies the alignment of

data and the justification of text in a cell. Possible values: – left left-flush data or left-justify text.

This is the default value for table data. – center center data or center-justify text.

This is the default value for table headers.

– right right-flush data or right-justify text. – justify double-justify text– char align text around a specific character as set

with a "char" attribute

Page 14: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

alignment: the "valign" attribute

• The "valign" attribute specifies the vertical position of data within a cell. Possible values: – top Cell data is flush with the top of the cell. – middle Cell data is centered vertically within the cell.

This is the default value. – bottom Cell data is flush with the bottom of the

cell. – baseline All cells in the same row as a cell whose

valign attribute has this value should have their textual data positioned so that the first text line occurs on a baseline common to all cells in the row. This constraint does not apply to subsequent text lines in these cells.

Page 15: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

alignment: "char" and "charoff"• The "char" attribute specifies a single character

within a text fragment to act as an axis for alignment. The default value for this attribute is the decimal point character for the current language as set by the "lang" attribute.

• The "charoff" attribute specifies the offset to the first occurrence of the alignment character on each line. If a line doesn't include the alignment character, it should be horizontally shifted to end at the alignment position. The direction of offset is determined by the current text direction, as set by the "dir" attribute. (obscure)

Page 16: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

alignment: "cellspacing"

• The "cellspacing" attribute specifies how much space the user agent should leave – between the left side of the table and the left-hand

side of the leftmost column– between the top of the table and the top side of the

top row,– between the right side of the table and the right-hand

side of the right most column– between the bottom of the table and the bottom side

of the last row– The attribute also specifies the amount of space to

leave between cells.

Page 17: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

alignment attributes: "cellpadding"

• Does the same as cellspacing, but gives the distance between the border of the cell and the and the contents.

• Note that "cellpadding" and "cellspacing" can only one length. – if it is pixel, horizontal and vertical dimensions are the

some– if it is a percentage, horizontal and vertical space are

different as the percentage is applied to the

Page 18: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

<thead>, <tfoot>, <tbody>

• These three tags enclose <tr> tags that belong to the head, the foot and the body of the table.

• Only one head and one foot, but optionally several bodies. Put head and foot first.

<table> <thead><tr> ...header information...</tr></thead> <tfoot> <tr> ...footer information... </tr></tfoot> <tbody><tr> ...first row of block one data... <tr> ...second row of block one data... </tr></tbody> <tbody><tr>...first row of block two data... </tr> <tr>...second row of block two data... </tr> <tr>...third row of block two data... </tr></tbody> </TABLE>

Page 19: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

<colgroup>

• this tag allows columns to be grouped together• it takes the alignment, core and i18n attributes• it takes a "span" attribute that says how many

columns are spanned• it takes a "width" attribute, to give the width of

the group. It takes percentage, pixel and relative length. A relative length is written i* where i is an integer. The higher i the more weight is given to the column when extra space is available for placing. "0*" means minimum space should be used.

Page 20: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

example

<colgroup span="40" width="1600"> is the same as<colgroup span="40"> <col width="40"> <col width="40"> ...a total of forty <col> elements... </colgroup> In the latter case, you don't actually need the

span=40 attribute.

Page 21: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

<col> tag

• <col> contains data about a single column. • takes the same attributes as <colgroup>,

remember, these are– alignment attributes– core attributes– i18n attributes– span– width

• needs to be enclosed in a <colgroup> tag:

Page 22: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

<col>, <colgroup> and rendition

• <col> and <colgroup> make it easier to render a table row by row.

• If you don't give them, the user agent has to read the whole table to find out how many columns there are at most.

• For long tables, this can mean additional delay.

Page 23: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

<tr>

• encloses a table row• it takes the alignment attributes• it takes the i18n attributes• it takes the core attributes.

Page 24: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <td> tag• encloses a cell in a table that is not a header cell• It admits the alignment and core attributes• It has an "abbr" attribute for abbreviated contents.• Its "rowspan" and "colspan" attributes say how

many rows or columns the cell spans. • It has a "headers" attribute specifies the list of

header cells that provide header information for the current data cell. The value of this attribute is a space-separated list of header cell "id" attribute values. (you can ignore this)

• It takes an "axis" attributes, whose purpose is so abstract that I will not cover it here.

Page 25: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <th> element• encloses a header cell• It admits the same attributes as <td>, but "headers" does

make no sense here. • Instead, we have a "scope" attribute that specifies the

set of data cells for which the current header cell provides header information. It can take the values– row: The current cell provides header information for the rest of

the row that contains it.– col: The current cell provides header information for the rest of

the column that contains it. – rowgroup: The header cell provides header information for the

rest of the row group that contains it. – colgroup: The header cell provides header information for the

rest of the column group that contains it.

Page 26: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Example by Lesk (1976)

Page 27: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Example by Lesk (1976)

Page 28: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Lesk's most famous

Page 29: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

subtle points of line breaking

• You can use the &nbsp; entity to indicate that you don't want a line break at that space, e.g. Prof.&nbsp;Dr.&nbsp;Krichel

• You can suggest the user agents to hyphenate a word at a certain point using the soft hyphen entity &shy;

• For the curious: an entity is something out of SGML that starts with & and ends with ; and that has special meaning.

Page 30: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <meta> tag in <head>

• This can be used to include metadata in the header.

• It has an attribute "name" for the property name• It has an attribute "content" for the property

values• it also takes the i18n attributes.• There is no standard set of names and values. • Example:

<meta name="author" content="Thomas">

Page 31: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <meta> tag in <head>

• There is also a special way to pass http headers to the client

• The "http-equiv" lets you set http variable and send them to the client.

• Example: <meta http-equiv="content-type"

content="text/html"> will tell the server to tell the browser that the

page is written in html.• more on this later, when we discuss http.

Page 32: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

"scheme" attribute of <meta>

• You can give a scheme attribute to <meta>.• Its content can be a name string, that the user

agent may be able to do something with• Or it can be a URI, where the user agent may

find something to do.• But there is no standard way to do things.

Page 33: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <base> tag in <head>

• Can fix the baseline URL for all the relative links in the document.

• Within the confines of what we are working with, I do not see a reason for you to use it.

Page 34: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

the <link> tag in <head>

• appears in the <head> of the page. No tag end.• creates a link between the current page and

others• takes the "href" attribute to say what page is

being pointed to.• takes "rel" attribute for forward link and "rev" for

the reverse link. Example:– Consider two documents A and B.

• Document A: <LINK href="docB" rel="foo">

– Has exactly the same meaning as:• Document B: <LINK href="docA" rev="foo">

Page 35: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

values of "rel" and "rev" attributesin <link>

• alternate • stylesheet !☻!• start • next • prev • contents • index • glossary • copyright • chapter • section • subsection • appendix • help • bookmark

Page 36: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

other attributes to <link>

• takes the core attributes (no idea why)• takes the "type" attribute for the MIME type of

the page linked to • takes the "hreflang" attribute to give the

language of the page linked to• takes the "charset" attribute to give the character

set of the page being linked to• takes the "media" attribute to give the media for

the page being linked to. Use the CSS media types.

Page 37: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

<link> and search engines

• Using <link> you can give search engine things like– Links to alternate versions of a document, written in

another human language. – Links to alternate versions of a document, designed

for different media, for instance a version especially suited for printing.

– Links to the starting page of a collection of documents.

• I am not sure if current engines use this.

Page 38: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Nielsen on style sheets• "one of the greatest hopes for recapturing the

Web's ideal of separation of presentation and contents".

• Use a single style sheet for your site. • Always use external style sheets.

– organizational benefits maximized– faster loading

• create a manual for the style of the organization• if you must allow for local styles, have these

embedded in the HTML code. • Make sure your site still looks reasonable in your

browser when you turn CSS off and reload the page

Page 39: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Don't go crazy with CSS

• More than two font families (plus perhaps one for computer code) and your page starts looking like a ransom note.

• Gimmicky looking sites will hurt the credibility of you site.

• No absolute font sizes.• If you have multiple style sheets, use the same

HTML class tags in both.

Page 40: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Nielsen on Frames

• He writes: "Frames: Just Say No"• He then has a few pages where he thinks about

why in exceptional circumstances frames may be ok.

• We have not discussed frame in this course at all and just mention them here.

Page 41: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Nielsen on printing

• Many people prefer to read documents in print. • For a long, important destination page, provide a

print version. Have the header say• <link rel="alternate" media="print"

href="mypage.pdf" type="application/pdf">• accommodate us-letter and a4 formats

– sheet as high as us-letter– sheet as wide as a4

This ends the Nielsen chapter on page design

Page 42: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Content design: writing

• write 50% of the words you would write in normal print, because research shows that reading on screen is 25% slower than print reading.

• write of scannability by using – short paragraphs– subheadings– bulleted lists

• Use hypertext to keep page size down.• (hire a copy editor)

Page 43: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

more on scannability

• structure pages with 2 or 3 levels of headings• you may want to highlight keywords in some

way, but not in any way that they could be confused with hyperlinks. Put the keywords in a <span class="keyword"> … </span>

• use meaningful, rather than cute headings.• use one idea per paragraph• almost no humor• no metaphors• no puns

Page 44: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

page chunking

• Just simply splitting a long article by into different parts for linear reading is not good.

• Devise a strategy of front pages with the important information and back pages linked from the front pages with the detail.

• Base the distinction of important and not important stuff on audience analysis.

Page 45: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

users rarely scroll

• early studies showed 10% of users would scroll.• on navigational pages, users will tend to click

something they see in the top portion.• scrolling navigational pages are bad because

users can not see all the options at the same time.

• the length of "destination" pages for users interested in details is less of a problem.

Page 46: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

page <title>

• needs to be cleverly chosen to summarize the page in a contents of a web search engine, esp.

• between 40 to 60 chars long• different pages in a site should each have their

own title.• No

– welcome– "a" "the" etc..

Page 47: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

headline design

• Explain clearly what the page is about• Use plain language• Skip leading articles ("A", "the"..) in email

subjects and page titles• Make the first word the most important one• Do not start all pages with the same word.

Page 48: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

legibility

• Use high color contrast.• Use plain or very subtle background images.• Make the text stand still

– no zooming– no blinking– no moving

• Left-align almost always• No all uppercase, it reads 10% slower.

Page 49: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

rules for online documentation (if you must have some)

• It is essential to make it searchable• Have an abundance of examples• Instructions should be task-oriented• Nevertheless, you may have to provide a

conceptual introduction to the system• Hyperlink to a glossary

Page 50: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

multimedia• Since such files are long, they should have an

indication of their size • Write a summary of what happens in the

multimedia document• For a video, provide a couple of still images.

This will give people– quick visual scan of the contents of the image – an impression of the quality of the image and

Page 51: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

pictures

• Have a picture on a bio page• No gratuitous images• More pictures on background pages, that are

reached by users with in-depth interest.• Never have a picture look like an advertising

banner.

• Maybe not have as many pictures of yourself on your site as Jakob Nielsen has.

Page 52: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

animation

• Animal instinct draws human attention to moving things

• A spinning logo is a killer for reading, if you have it, have it spin only a few times

• No scrolling marquees, no moving text

Page 53: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

animation may be good for

• Showing continuity in transition• Indication dimensionality in transaction• Illustrating change over time• Multiplexing the display• Enriching graphical representation• Visualizing three dimensional structures• Attracting attention

but we will not discuss this as it is out of scope for the course

Page 54: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

streaming video

• limited by available bandwidth• could be used for

– promoting television shows, films etc– give user impression of a speaker's personality (if any)– demonstrate things that move

• good for demo of physical products• less good for demos of software

• watch out for narration quality

Page 55: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

Downloadable video

• probably better than streaming• breaks the interactive mode of use on the web• should be limited in length, say < 1 minute• big topics should be broken down on a web

page into smaller ones, each having its own video.

Page 56: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

audio

• probably a better way to convey a speaker's personality

• can teach the pronunciation of words• can enhance the user experience, a classic

study had users claiming that the graphics were better on a video game that had better sound but the same graphics than another.

Page 57: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

3D graphics

• has a range of problems– man is not made for 3D watching– screen is not made for rendering 3D– interaction tools such as mouse have not been made

for 3D– poor screen resolution– requires plug-ins

• therefore it should not be used unless absolutely necessary.

Page 58: LIS650 lecture 3 Minor HTML Thomas Krichel 2004-02-20

http://openlib.org/home/krichel

Thank you for your attention!