24
Web Design and HTML Lecture 14 – COMPSCI111/111G SS 2018

L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Web Design and HTMLLecture 14 – COMPSCI111/111G SS 2018

Page 2: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

u Mike Barley

u Email: [email protected]

u Room: 488 Building 303S

u Office Hours: by appointment/drop by

u Email: ALWAYS PUT “CS 111” INTO SUBJECT LINE!!!!!

CompSci 111 2018 2

Page 3: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Web Page vs Web Site

u A web page is a single page viewable using web browser

u Should be visually appealing, informative

u A web site is a set of web pages

u Same theme

u Consistent design

Design and HTML 3

Page 4: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Navigation

u Users have trouble navigating in many web sites

u Navigation should be easy - three click-rule

u Navigation bar on the left is common

u Navigation bar on the right is more ergonomic

u Each page should

u Tell the user what the page is about

u Clearly identify how to get to other pages (Obvious links)

u Familiarity

Use layout and design that people are familiar with

Design and HTML 4

Page 5: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Links

u Don’t make the user guess where the links are

u All links should be clearly identified

u Underlining

u Do not underline any normal text.

u Remember that links are different colour to normal text

u Check the appearance of links on your background

u Name of the link should indicate where it links to

u Don’t use “Click here”

Design and HTML 5

Page 6: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Text

u Make the text easy to read

u Keep text short – reading on screen is 15% slower than paper

u Bullet points, headings, empty space

u Use a word processor to prepare the text (spelling)

u Use good titles for page

u Sensible headings

u Make the text legible

u Font size (not too small to read, not too large)

u Aligned to the left. Centre only used for headings

u Colours / contrast

u Not all uppercase / italic / bold

Design and HTML 6

Page 7: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Bad use of colour

u Colour

u Use sparingly to reinforce other information

u Colour blindness (Red / Green, Blue / Yellow)

u Poor use of contrast

u Don’t over use colour over just because “it is there”

Design and HTML 7

Page 8: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Images and Backgrounds

u Design for low bandwidth

u Use images that have small file sizes

u File Formats

u JPEG for photos

u GIF / PNG for graphics

u Backgrounds

u Simple

u Consistent across the entire site

u Should not interfere with content

Design and HTML 8

Page 9: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Things to avoid

u Keep the design simple

u Avoid making the page cluttered

u Avoid using Frames

u Make navigation more difficult

u Avoid using Flash animations

u Not all browsers support flash

u Takes too long to download

u Cannot be indexed / searched

Design and HTML 9

Page 10: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

HTML

u Hypertext Markup Language (HTML)

u Used to format web pages

u Contains hypertext information (links)

u Written in ASCII / Unicode

u Embedded format codes (tags)

Design and HTML 10

Page 11: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Browser Wars

u HTML 1.0

u Tim Berners Lee (1993)

u Browsers added extra features

u Internet Explorer had unique tags

u Netscape Navigator had unique tags

u Major problem

u What tags should a publisher use?

u How can this problem be resolved?

Design and HTML 11

http://en.wikipedia.org/wiki/Browser_wars

Page 12: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Development of HTMLu HTML 2.0

u Internet Engineering Task Force standard (1995)

u HTML 3.2 / HTML 4.0

u W3 Consortium recommendation (1997)

u HTML 4.01

u W3C recommendation (1999)

u XHTML 1.0

u W3C recommendation (2000)

u HTML5

u Fifth revision of HTML standard. Standardized October 2014.

Design and HTML 12

http://en.wikipedia.org/wiki/Html

Page 13: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Document Type Definition

u Defines which standard is being used for the page

u We use HTML5

u Should appear at the top of the file

Design and HTML 13

<!DOCTYPE html>

Page 14: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Encoding methods

u Different character sets used to encode the page

u ASCII

u UTF-8

u Unicode

u Need to tell the browser which encoding is used

u Located in the head of the document.

Design and HTML 14

<meta charset="UTF-8">

Page 15: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Use at the start of every file

u Copy and paste the code exactly as it appears

u Will be provided in tests and exams

Design and HTML 15

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"> </head>

Page 16: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

HTML Source Code

u Code used by the browser to display the page

u White space is ignored

u Comments

u Ignored by the browser

u Allow you to document your code

u <!-- Put your comment here -->

u Layout

u Use tidy layout where possible

u Make code easy to understand

u Make code easy to maintain/ modify

u Use whitespace and comments to help

Design and HTML 16

Page 17: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Overview of tags

u Markup achieved with “tags”

u Enclosed with angle brackets < … >

u Use lower case

u Most come in pairs <tag> … </tag>

u Tag usually applies to text between start and end tag

Design and HTML 17

This word is in <span>italics</span>

Page 18: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Attributes

u Some tags require additional information

u Properties or attributes of the tag

u <tag property=“value”> </tag>

Design and HTML 18

Page 19: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Nested Tags

u Tags must be correctly nested

u Cannot close an open tag until all the open tags that it affects are also closed

Design and HTML 19

<tag>Text only affected by “tag”

<tag2>Text affected by both “tag” and “tag2”</tag2>

Text only affected by “tag”</tag>

Page 20: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Essential tags

<html lang="en">

u Encloses the entire document

u Specifies that the document uses html

u lang attribute is used to specify the primary language of a webpage – en is the code for English

Design and HTML 20

<html lang="en">........</html>

Page 21: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Essential tags

<head>

u Contains information for the browser

u E.g. character encoding used

u Does not contain any content to be displayed on the page

Design and HTML 21

<html lang="en"><head><meta charset="UTF-8"></head>.....</html>

Page 22: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Essential tags

<body>

u Contains all the content that will appear on the page

Design and HTML 22

<html lang="en"><head><meta charset="UTF-8"></head><body>...</body></html>

Page 23: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

Essential tags

<title>

u Part of the head

u Specifies the title to be used by the browser

u Name of the window

u Used in navigation (bookmarks, history, etc.)

Design and HTML 23

<html lang="en"><head><meta charset="UTF-8"><title>Introduction to tags</title></head><body>...</body></html>

Page 24: L14 Design And HTML€¦ · Web Page vs Web Site uA web page is a single page viewable using web browser uShould be visually appealing, informative uA web site is a set of web pages

HTML5 Exercise

Design and HTML 24

Exercise 1: What does HTML stand for?

• Hypertext Markup Language

Exercise 2: What is a document type definition used for?

• Defines which standard is being used for the webpage

Exercise 3: What is “white space”?

• Characters or series of white space characters that define horizontal or vertical spaces