41
HTML Page Structure

HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

HTML Page Structure

Page 2: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

2

Learning Outcomes

• Understand the structure of an HTML Element, and be able to recognize its variants.

• Be able to read and compose a relative path, and be able to distinguish it from an absolute path.

• Understand the implications of nesting of elements, and in particular be able to distinguish between correct and incorrect nesting.

• Be able to differentiate between block and inline elements

• Understand the general context of wireframing

Page 3: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

3

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 4: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

4

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 5: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Components of an HTML Element

5

Page 6: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

6

Components of an HTML Element

<ElementName > Content</ElementName>

Start Tag

End Tag

Page 7: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

7

<title>

ElementName: <title> Content: My App Store ElementName: </title>

<title> My App Store </title>

Page 8: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

8

<p>

ElementName: <p> Content: 600 million YouTube views later, Dude Perfect is back with their most epic game yet! Go BIGGER than ever hitting mind-blowing trick shots through tons of crazy levels! ElementName: </p>

<p> 600 million YouTube views later, Dude Perfect is back with their most epic game yet! Go BIGGER than ever hitting mind-blowing trick shots through tons of crazy levels!</p>

Page 9: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

9

Attributes

• Attributes give you a way to specify additional information about an element.

Page 10: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

10

<a>

ElementName: <a> AttributeName: hrefAttributeValue: “apps.html”

Content: App Store ElementName: </a>

<a href=“apps.html”> App Store </a>

Page 11: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

11

<img>

ElementName: <img> AttributeName: srcAttributeValue: "../images/delete.jpg"

Content: empty ElementName: none

<img src=“../images/delete.jpg”/>

Page 12: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Attributes

12

Page 13: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

13

HTML Document Structure

• html• head• title

• body• h1• ol• etc...

Page 14: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

14

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 15: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

15

Linking

Page 16: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

16

Linking to other pages or images

• Creating links to other web pages and to image files can get confusing! If your link to a file or page is incorrect you get:

Whoops we can’t seem to find that page! (404 error )

Or

No image shows and you have a broken link to an image

Page 17: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Links: Absolute vs Relative

Absolute• Complete path to a file on the hard disk: e.g:

C:/My Documents/webdevelopment/lab01/images/xbox.jpgC:My Documents/webdevelopment/lab01/movies.html

• Relative: ./images/xbox.jpg ../apps.html index.html

Trace route from “current position” to the destination“..” means go up one levelDirectory name may prefix filename

17

Page 18: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

18

Relative Link Examples

• If we are in “lab1” then “images/plane.png” is a relative link from the current folder (Lab1) to the images folder, and to the file “plane.png” in that folder

• If we are in the images folder, and we wish to link to one of the web pages, the link “../movies” means “go up one level, and then find “movies.html”

• Avoid absolute links!

<img src=“./images/warrior.jpg">

<a href=“movies.html">Movies</a>

Page 19: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

19

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 20: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

20

Nesting

• When we put one element inside another element, we call that nesting.

• We say, the <p>element is nested inside the <body>element.

• We put a <body>element inside an <html>element, a <p>element inside a <body>element etc.

Page 21: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

21

Text

Nesting - Tree Structure

Page 22: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

22

<p>I’m so going to blog <em>this</em></p>

Nesting can be Incorrect!

Good

<p>I’m so going to blog <em>this</p></em>

Bad?

Page 23: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

23

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 24: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Line breaks

24

Page 25: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Line Breaks

25

Page 26: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Line Breaks

26

Page 27: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

27

Line Breaks

• Break: <br> </br>

• An Empty element: - sometimes shortened to:

• <br></br>

• or just

• <br>

• or

• <br />

Page 28: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

28

“Block elements stand on their own; inline elements go with the flow.”

Block vs Inline Elements

• Block elements are always displayed as if they have a line break before and after them

• inline elements appear “in line” within the flow of the text in your page.

Page 29: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

29

• Block - h1, h2, p, blockquote

Examples

• Inline - a, em, q

Page 30: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

30

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 31: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

31

Planning a Document (1)

• Visualizing End Result

Page 32: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

32

Planning a Document (2)

• Identify Block Structure

Page 33: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

33

Planning a Document (3)

• Building blocks

• Don’t forget <html> <head> and <body>

• Translate to html

• Build content

Page 34: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

34

Page 35: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

35

Wire framing

• A website wireframe is a basic visual guide used in interface design to suggest the structure of a website and relationships between its pages.

• A webpage wireframe is a similar illustration of the layout of fundamental elements in the interface. Typically, wireframes are completed before any artwork is developed.

Page 36: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

36

Agenda

• Elements, Attributes, & Documents

• Linking

• Nesting

• Linebreak, Block & Inline Elements

• Structuring a Page / Wireframing

Page 37: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

37

Learning Outcomes

• Understand the structure of an HTML Element, and be able to recognize its variants.

• Be able to read and compose a relative path, and be able to distinguish it form an absolute path.

• Understand the implications of nesting of elements, and in particular be able to distinguish between correct and incorrect nesting.

• Be able to differentiate between block and inline elements

• Understand the general context of wireframing

Page 38: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Steps

Instructions for each step

38

Labs

Page 39: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Typical Lab:

• Screen shots to show outcome

• Some html to type• More screen shots to• show expected

outcome• Reflect as you go

along

39

Page 40: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

Lab-1.1

• Introduce you to the tools we will use during the web development

• Introduce you to creating, editing, saving and displaying a simple web page.

40

Page 41: HTML Page Structure...2 Learning Outcomes • Understand the structure of an HTML Element, and be able to recognize its variants. • Be able to read and compose a relative path, and

41

Lab 1.1Create a WebDevelopment folder

to contain a new Lab folder each week.

Create a simple static web site, and be able to manage it within the Sublime environment

Familiar with the following HTML elements:

<html> <head> <title> <link> <body> <h1> <h2> <p> <a> <img> <ul> and <ol>