xp 2 html tutorial 1: developing a basic web page

19

Upload: ashley-montgomery

Post on 02-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: XP 2 HTML Tutorial 1: Developing a Basic Web Page
Page 2: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

2

HTML

Tutorial 1: Developing a

Basic Web Page

Page 3: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

3

HTML: The Language of the Web

Web pages are text files, written in a language called Hypertext Markup Language (HTML).

A markup language is a language used to describe the document’s structure and content.

HTML was developed from the Standard Generalized Markup Language (SGML), a language used for large-scale documents.

SGML proved to be cumbersome and difficult, thus HTML was created.

Page 4: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

4

Hypertext Markup Language (HTML)

HTML allows Web authors to create documents that can be displayed across different operating systems.

HTML code is easy to use, that even nonprogrammers can learn to use it.

HTML describes the format of Web pages through the use of tags.

– it’s the job of the Web browser to interpret these tags and render the text accordingly

Page 5: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

5

HTML Continued

HTML has a set of rules, called syntax.

– syntax are a set of standards or specifications developed by a consortium of Web developers, programmers, and authors called the World Wide Web Consortium (WC3)

HTML extensions have been added to support new features, which have been adopted in subsequent sets of standards released by the W3C.

Page 6: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

6

Web Development

In the future, Web development is focusing more on XML (Extensible Markup Language) and XHTML (Extensible HyperText Markup Language) for developing document content.

XML combined with style sheets provides the same functionality as HTML, but with greater flexibility

XHTML was designed to overcome some of the problems with competing HTML standards

Page 7: XP 2 HTML Tutorial 1: Developing a Basic Web Page

heading 1

image

horizontal lineparagraph

list

bold and italic text

heading 3

Creating an HTML DocumentPlan the appearance of your Web page before you start writing code

Page 8: XP 2 HTML Tutorial 1: Developing a Basic Web Page
Page 9: XP 2 HTML Tutorial 1: Developing a Basic Web Page
Page 10: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

10

HTML Tags

Tags can be one-sided or two-sided.– two-sided tags contain an opening tag <b> that tells

the browser to turn on a feature and apply it to the content that follows, and a closing tag </b> that turns off the feature

– one-sided tags are used to insert noncharacter data into the Web page, such as a graphic image or video clip <tag attribute>

Tags are not case sensitive. The current standard is to display all tags in lowercase letters.

Page 11: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

11

Making Elements with Tags

To create a two-side tag, use:<element>content</element>

To create a one-side tag, use: <element />

where element is the name of HTML element

Page 12: XP 2 HTML Tutorial 1: Developing a Basic Web Page

The Structure of an HTML File

<html>

</html>

<head>

</head>

<title></title>

<body>

</body>

Page 13: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

13

Block-Level Elements(see Figure 1-20)

A block-level element contains content displayed in a separate section within the page, setting it off from other blocks

Examples:

<p> . . . </p>

<h1> . . . </h1>

<ul> . . . </ul>

Page 14: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

14

Creating Lists

HTML supports three kinds of lists:

an ordered list, which is used to display information in a numeric order

an unordered list, which list items not in a particular order i.e. bullets

a definition list, which is a list of terms, each followed by a definition line that is typically indented slightly to the right

Page 15: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

15

Inline Elements (see Figure 1-21)

An inline element is part of the same block as its surrounding content - e.g., individual words or phrases within a paragraph.

Examples:

<b> . . . </b>

Page 16: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

16

Inserting an inline image

<img src=“file” alt=“text” />

<p style=“text-align: center”><img src=“dube.jpg” />

</p>

Page 17: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

17

Inserting Horizontal Lines

A horizontal line can improve the appearance of a Web page.

<hr style=“color: color; background-color: color;

width: width; height: height” />

<hr style=“color: red; background-color: red; height: 2; width: 100%>

Page 18: XP 2 HTML Tutorial 1: Developing a Basic Web Page

Special Characters in the Browser

accented é addedto last name

Dub&#233;

Page 19: XP 2 HTML Tutorial 1: Developing a Basic Web Page

XP

Tips for Good HTML Code

Use line breaks and indented text to make your HTML files easier to read

Insert comments into your HTML file to document your work

Enter all tag and attribute names in lowercase Place all attribute values in quotes Close all two-sided tags Use styles whenever possible

19