37
1 HTML Introduction HTML Introduction HTML HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

  • View
    221

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

1

HTML IntroductionHTML Introduction

HTMLHTML

Today’s goals:Introduce HTMLHand Code your project in HTMLUpload to your uweb folderView your new page on the Web!

Page 2: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

2

Introduction to HTMLIntroduction to HTML

Scholarly Writing and the InternetScholarly Writing and the Internet

No clear favorites among tools and techniques for “Internet documentation.”

Format can be:– Hand-coded HTML– HTML via an authoring tool (e.g.,

Dreamweaver)The most significant requirement is

some knowledge of HTML.

Page 3: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

3

Introduction to HTMLIntroduction to HTML

Some acronymsSome acronyms

HTML: Hypertext Markup Language, the format used on the World Wide Web.

HTTP: Hypertext Transfer Protocol, the language used to transfer HTML files from web servers to browsers.

URL: Universal Resource Locator, an address for information on the web.

Page 4: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

4

Introduction to HTMLIntroduction to HTML

What is HTML?What is HTML?

When you look at a Web page, you are looking at HTML.

HTML is a languageHT = HypertextML = Markup LanguageHTML files are ASCII text files.HTML files end in .HTM or HTML.

Page 5: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

5

Introduction to HTMLIntroduction to HTML

What is HTML?What is HTML?

Markup codes define document structure.

Internet browsers interpret markup codes so that formatting is displayed.

To see a file in its source format, view it in a text editor such as Notepad.

Markup codes are visible and editable.

Page 6: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

6

Coding HTMLCoding HTML

Viewing page and source codeViewing page and source code

Open Internet Explorer.Browser displays a formatted page.To see HTML source code, from the

View menu select Source. See how document elements are

tagged. For example, there are tags for Heading 1, lists, etc.

Page 7: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

7

Coding HTMLCoding HTML

HTML source codeHTML source codeTags are codes enclosed in angle

brackets. For example:<h1>Works Cited</h1>

is a line of text that uses the Heading 1 tag.

The tag is <h1>

Page 8: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

8

Coding HTMLCoding HTML

Well formed HTML source codeWell formed HTML source code

Basic rules of well-formed HTML:– Tags (elements) are lower case. For

example, <h1>. – Tags must have closing tags. For example,

<h1>This is heading 1</h1>– Tags must nest properly. For example,

<h1>This is <em>heading 1</em></h1>– Attribute values must be quoted. For

example, <background-color=“blue”>

Page 9: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

9

Introduction to HTMLIntroduction to HTML

Let’s Start CodingLet’s Start Coding

You will hand code your project by adding:Head and body sectionsHeadingsImagesHyperlinks

– External links– Connecting Multiple Pages

Page 10: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

10

Coding HTMLCoding HTML

Use Notepad and browserUse Notepad and browser

Open Notepad and save the file as “index.html”.

HTML file names– Uweb.ucsb.edu/~kknight– Uweb.ucsb.edu/~kknight/mypage.html

Open the file with Internet Explorer

Page 11: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

11

Coding HTMLCoding HTML

Use Notepad and the browserUse Notepad and the browser

You will work with both Notepad and the browser open.

Make changes in Notepad.Save changes.Click Refresh in the browser to see your

changes.

Page 12: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

12

Coding HTMLCoding HTML

The HTML tagThe HTML tagThe first tag in every HTML file is the

HTML tag.This tag tells the browser that the file is

HTML.In Notepad, at the beginning of

index.html, type

<html></html>

Page 13: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

13

Coding HTMLCoding HTML

The HEAD tagThe HEAD tag

Follows the HTML tag.Sets up an area for items that don’t

appear on the page:– The title that appears in the browser

window’s title bar.– Keywords that identify your page to Internet

search engines.

Page 14: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

14

Coding HTMLCoding HTML

Insert the HEAD tagInsert the HEAD tag

After the <html> tag, type

<head>

</head>

Page 15: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

15

Coding HTMLCoding HTML

The TITLE tagThe TITLE tag

Contains the title that appears in the browser window’s title bar.

Goes in the HEAD section.The title is not visible in the page itself.The format of the Title tag is

<title>Works Cited</title>

Page 16: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

16

Coding HTMLCoding HTML

Insert a TITLE tagInsert a TITLE tag

Between the HEAD tags, type:

<title>Works Cited</title>

Page 17: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

17

Coding HTMLCoding HTML

Save and check your workSave and check your work

In Notepad, click File, Save.In the browser, Click Refresh and note

changes in the title bar.

Page 18: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

18

Coding HTMLCoding HTML

The BODY tagThe BODY tag

The BODY section contains the text and graphics that appear on your page.

The BODY section follows immediately after the HEAD section.

The format of the BODY section is

<body>All text and graphics on the page.

</body>

Page 19: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

19

Coding HTMLCoding HTML

Insert the BODY tagInsert the BODY tag

After the </head> tag, type <body>.After the end of the text on the page,

type </body>.

Page 20: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

20

Background ColorBackground Color

<body bgcolor=“colorname”> No closing tag required You can use the names of colors: green, pink,

etc. You can also use hex values for the colors - an

alphanumeric code that gives different shades of green, pink, etc.

Find hex codes on webmonkey.com under “Color Codes.”

Page 21: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

21

Coding HTMLCoding HTML

Heading TagsHeading Tags

Heading tags define the sections on your page.

Headings are hierarchical: Heading 1, Heading 2, Heading 3, etc.

The format of Heading tags is<h1>This Is Heading 1</h1>

<h2>This Is Heading 2</h2><h3>This Is Heading 3</h3>

Page 22: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

22

Coding HTMLCoding HTML

Heading Tags for Your PageHeading Tags for Your Page

In the body section of your page, enclose the title with <h1></h1>, so that it looks like this:

<h1>Heading</h1>Save the file in Notepad, then refresh

the page in your browser.

Page 23: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

23

Heading Tags & AlignmentHeading Tags & Alignment

Alignment– The default alignment is left-justified– To center your heading, insert the following

tag <center></center> Remember to embed or “nest” them properly <h1><center>Title</center></h1>

– To do right justification, you have to create a division within the code:

<div><div align=“right”>Content</div>

Page 24: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

24

Coding HTMLCoding HTML

Paragraph tagsParagraph tagsInsert the <p> tag at the beginning of

each paragraph and </p> at the end.Otherwise, lines of text will appear as a

single paragraph in browser, even if you have line breaks in text file.

To put a line break in, use the <br> tag

Page 25: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

25

HTMLHTML

Font tagsFont tags

You can format text using HTML font tags:– <em></em> Renders as italic text style. – <strong></strong> Renders as bold text style. – <font size=“#”></font> Renders text different

sizes. The attribute values range from 1 - 7, with 1 being the smallest.

– <font color=“color”></font> Renders text a different color

– You can combine the font color and font size tags as follows:

– <font color=“color”; size=“#”></font>

Page 26: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

26

HTMLHTML HyperlinksHyperlinks

HTML files can contain hyperlinks to files on the same computer or around the world.

3 types of links: external, internal, and “mail to”

Page 27: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

27

HTMLHTML External Links External Links

All Link tags require two components– The location you want to link to– The text that you want to appear on the

page<a href=“http://www.ucsb.edu”>Link

Text</a>In an external link, this is the web

address of the site

Page 28: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

28

Internal LinksInternal Links An internal link is very similar to an external

one. The difference is that you are linking to another

html file on your own server. You’ll first need to decide what to name the

second file - remember all lowercase, no spaces. Then construct a link with the name of your new

file: <a href=“page2.html”>Next</a>

Page 29: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

29

Mail-to LinksMail-to Links

These allow interested viewers to contact you.

<a href=“mailto:[email protected]”> Contact Me</a>

Page 30: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

30

HTMLHTML

ImagesImages You can insert images into HTML code. You insert an image reference using the <img

src = > tag. For example, <img src = “zoo.gif”> inserts the

zoo.gif file. No closing tag needed. You can also specify the height and width of

images to make the rest of the page load faster. <img src=“zoo.gif” height=100px width = 100px>

Upload image files with your html files.

Page 31: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

31

Coding HTMLCoding HTML

Upload Your File Using UwebUpload Your File Using Uweb

– Open your browser and go to www.umail.ucsb.edu

– Click the ustorage button on the left of the screen

– Click U-Storage Manager– Log in using your UCSBnetID and

password. This is the same ID and password you use to access Umail.

Page 32: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

32

Coding HTMLCoding HTML

Upload Your File Using UwebUpload Your File Using Uweb

– Click the ustorage button on the left of the screen

– Click U-Storage Manager button on the left of the screen

– You will want to upload index.htm to the uweb folder. So click on uweb.

Page 33: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

33

Coding HTMLCoding HTML

Upload Your File Using UwebUpload Your File Using Uweb

– Scroll to the bottom of the screen to the File Upload section.

– Click Browse and go to the folder containing our index.html file.

– Select index.html and click upload file.

Page 34: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

34

Coding HTMLCoding HTML

Upload Your File Using UwebUpload Your File Using Uweb

– Point your browser to the following url:

www.uweb.ucsb.edu/~UCSBnetID– Your page should now appear!– As you update this page, you will repeat

this process of uploading the new page to uweb. Refer frequently to this procedure.

Page 35: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

35

HTMLHTML Authoring ToolsAuthoring Tools

Authoring tools shield you from having to deal directly with HTML code:– HomeSite – DreamWeaver– Microsoft FrontPage– Adobe PageMill

DreamWeaver is used at UCSBKnowing some of the code is very useful.

Page 36: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

36

Additional ToolsAdditional Tools

You can always “view source” on a page to see what code has been used to create a certain effect.

Webmonkey.com - html cheat sheet, color codes, etc.

Page 37: 1 HTML Introduction HTML Today’s goals: Introduce HTML Hand Code your project in HTML Upload to your uweb folder View your new page on the Web!

37

HTMLHTML What we coveredWhat we covered

Head and Body sectionsTitle tag: <title>Headings: <h1>Text formattingHyperlinksImagesUploading your site