Creating Web Pages with Links, Images, and Formatted...

38
HTML Project #3-Links, Images, & Formatted Text Project 3 Creating Web Pages with Links, Images, and Formatted Text

Transcript of Creating Web Pages with Links, Images, and Formatted...

Page 1: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

HTMLProject #3-Links, Images, & Formatted Text

Project 3

Creating Web Pages with Links, Images, and Formatted Text

Page 2: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

2HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Project Objectives

1. Describe linking terms and definitions2. Create a home page and enhance a

Web page using images3. Align and add bold, italics, and color to

text 4. Change the bullet type used in an

unordered list5. Add a background image

Page 3: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

3HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Project Objectives

6. Add a text link to a Web page in the same Web site

7. Add an e-mail link8. View the HTML file and test the links9. Open an HTML file10.Add an image with wrapped text

Page 4: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

4HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Project Objectives

11.Add a text link to a Web page on another Web site

12.Add links to targets within a Web page13.Copy and paste HTML code14.Add an image link to a Web page in the

same Web site

Page 5: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

5HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Web Page Heading

• Always label the top of your assignments using the following comments:

<!--Name --><!--Date --><!--Assignment Name-->

Page 6: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

6HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Web Page Structure/Skeleton

<html>

<head><title>Your title goes here</title>

Note: Title shows up on the “title bar” of the web page & on page when it is printed.

</head> and then press the ENTER key

<body>Page content goes here</body>

</html>

Page 7: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

7HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Saving A Web Page

• Click File-->Save to save your files– The First time you save any project, the

Save As dialog box will automatically appear, since you are making a NEW FILE

– Using File-->Save As… after this will save your work as another new file, therefore creating a DUPLICATE of your work

– If you’ve already saved something before, only use File-->Save to save it again

Page 8: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

8HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Saving a Web Page

• You will always need to type the extension “.htm” when saving your pages.

Page 9: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

9HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Different Views, Same File• The .htm file will appear differently when viewed in Notepad vs.

Internet Explorer– Notepad is only a text editor, whereas Internet Explorer is a browser--it will interpret

your code into visuals.Notepad View Internet Explorer View

Page 10: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

10HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Printing An HTML File

• Click File-->Print• When the dialog box appears, click OK

Page 11: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

11HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Aligning Headings with a Font Color

<h1><font color="#000066">Welcome to Plant World!</font>

</h1>

Page 12: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

12HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Entering a Paragraph of Text

<p>A paragraph of text goes here

</p>

• The browser will put two line breaks after each closing tag

Page 13: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

13HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Creating Unordered (Bulleted) Lists

• Random sequence• Circles, Dots, Squares, special symbols

etc..• Requires TWO Tags to make it work

<ul><li> </li>

</ul>

Page 14: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

14HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding a Text Link to Another Web Page within the Same Web Site

• Use the anchor tag to create links.• href attribute – tells the browser what page to

link to• As long as you are linking to a page within the

same site, you only need to include the filename.

<a href = "desertplants.htm"> Desert Plants

</a>

Page 15: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

15HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding a Text Link to a Web Page in Another Web Site

• When linking to a page in another site, enter the full web address as the value for href.

<a href="http://www.google.com">Click to go to Google.com.

</a>

Page 16: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

16HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding an E-Mail Link

• Use an anchor tag, as you would when creating a link to a web page

<a href =“mailto:[email protected]”>Click Here to send an E-Mail

</a>

Page 17: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

17HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Viewing a Web Page

• Open Internet Explorer– Click Start-->All Programs-->Internet Explorer– OR Double click the Internet Explorer Icon on

the desktop• Opening a Page

– Click the Address bar– Type the URL or file path of the page you want to

view and press ENTER– If the file is on your computer, you can also click

File-->Open and browse for the file instead

Page 18: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

18HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Testing Links in a Web Page

• Whenever you’ve made a new link, you should test it to make sure it works

• When viewing your file, click each of the links and make sure they do what they should

Page 19: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

19HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Opening an HTML File• Open Notepad• Click File-->Open• If necessary, click the Look in box arrow and then

select the U:/ Drive• Double-click your folder-->Web Design-->project#• If necessary, click the Files of type box arrow and

then click All Files• Double-click the file you want to open, OR single

click and then click the Open button in the Open dialog box

Page 20: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

20HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Formatting Text in Bold

<b>The browser will display this text in bold

</b>

Page 21: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

21HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Formatting Text in Italics

<em>“Em” is for “Emphasized”. In most browsers, this text will be italicized.

</em>

Page 22: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

22HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Formatting Text with a Font Color

• Sometimes a browser will recognize color names (i.e. <font color = “red”>)

• However, you will need to use the hexadecimal code for a color if you want a very specific color that doesn’t have a name

• Googling “hexadecimal color codes”should help you find codes for any color

Page 23: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

23HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Formatting Text with a Font Color

<font color="#FF00FF"> Pretty in Pink

</font>

Page 24: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

24HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding a Background Image

• Background is an attribute of the body tag.• Value = filename if image file is in the

same folder as the .htm file• Otherwise, Value = filepath/filename

<body background=“greyback.jpg”>

Page 25: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

25HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding an Image

<img src="plantworldlg.jpg“ width="720“height="84“ alt="Plant World logo" />

• Important attributes:– src is the file path / file name– width/height are the dimensions of your image– alt is the text that will display if the image can’t

Page 26: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

26HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding an Image with Wrapped Text

<img src="butterfly.jpg" align="left" alt=“Swallowtail“width="245“height="198" />

<font size = "5">Image is left-aligned, with wrapped text…

</font>

This inserts a left-aligned image with wrapped text, as shown on the next slide. Align = “right” will align the image on the right instead.

Page 27: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

27HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding an Image with Wrapped Text

Page 28: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

28HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Clearing the Text Wrapping

<img src="butterfly.jpg" align = "left">

<font size = "5">Image is left-aligned, with wrapped text Image is left aligned, with wrapped text

<br clear = "left">Image is left-aligned, with wrapped text Image is left-aligned, with wrapped text Image is left-aligned, with wrapped text

</font>

Note: This is the same code as before,Only now with a break, clearing thetext wrapping. Differences shownon the next slide.

Page 29: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

29HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Clearing the Text Wrapping

Here is the same page, now with textcleared to the left

Above is the result of the original code

Page 30: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

30HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Setting Link Targets

<a name=“point1"></a> • This creates a link target named point1

<a href = “#point1”>Click here</a>• This link will take the user to the part of the

page that contains the point1 target• Don’t forget to type “#” before the target

name when linking

Page 31: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

31HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding Links to a Target at the Top of the Page

• First, make a link target<a name=“angles"></a>

• Then create a link to it:<a href=“#angles"><To top</a><a href=“baseball.#angles"><To top</a><a href=" sports/baseball.#angles "><To top</a>

Page 32: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

32HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Copying and Pasting HTML Code

• Highlight the HTML code you want to copy• Click Edit --> Copy, or press Ctrl + C

• Position the insertion point where you want to paste the text

• Click Edit --> Paste, or press Ctrl + V

Page 33: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

33HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding an Image Link to a Web Page

• Enclosing an image within anchor tags will make it a link

• By default, the image will be given a borderto show that it is a link

• Typing border = “0” in the image tag will get rid of this border

Page 34: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

34HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Adding an Image Link to a Web Page

<a href="plantworld.htm">

<img src="butterfly.jpg" align="left" alt=“Swallowtail“width="245“height="198“border = “0” />

</a>

Page 35: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

35HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Project Summary

1. Describe linking terms and definitions2. Create a home page and enhance a

Web page using images3. Align and add bold, italics, and color to

text 4. Change the bullet type used in an

unordered list5. Add a background image

Page 36: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

36HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Project Summary

6. Add a text link to a Web page in the same Web site

7. Add an e-mail link8. View the HTML file and test the links9. Open an HTML file10.Add an image with wrapped text

Page 37: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

37HTML Project 3: Creating Web Pages with Links, Images, and Formatted Text

Project Summary

11.Add a text link to a Web page on another Web site

12.Add links to targets within a Web page13.Copy and paste HTML code14.Add an image link to a Web page in the

same Web site

Page 38: Creating Web Pages with Links, Images, and Formatted Textvhstigers.org/ourpages/auto/2007/9/10/1189445655202... · 9/10/2007  · HTML Project 3: Creating Web Pages with Links, Images,

HTMLProject #3-Links, Images, & Formatted Text

Project 3 Complete

Homework:AYK:ITL:Cases & Places: