Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Texas Education Agency, 2013. All rights reserved.1 Web Technologies Introduction to HTML Scripting.

Similar presentations


Presentation on theme: "Copyright © Texas Education Agency, 2013. All rights reserved.1 Web Technologies Introduction to HTML Scripting."— Presentation transcript:

1 Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Introduction to HTML Scripting

2 Part 1 Basic Tags & Structure Copyright © Texas Education Agency, All rights reserved.2

3 Benefits of Learning HTML Webmasters with coding ability are in high demand. HTML is the core language of all websites. Coding ability provides for better control over website development. Designers can easily adapt to updates in web design technology. Copyright © Texas Education Agency, All rights reserved.3

4 Before Getting Started You will need a text editor. Notepad, Notepad 2, or Notepad++ is preferred. You should have a designated location or web directory to save the examples. Copyright © Texas Education Agency, All rights reserved.4

5 The Text Editor Web pages are nothing more than text files with formatting instructions. Quality web pages can be created in simple text editors such as Notepad. Copyright © Texas Education Agency, All rights reserved.5

6 What is HTML? Stands for Hyper Text Markup Language Any computer can read the HTML markup HTML is a formatting language, NOT a programming language. Copyright © Texas Education Agency, All rights reserved.6

7 Web Page Structure The and tags start and end the document. They tell the browser where the starting point and ending point of your web page is. The heading and the body are the two main sections of a web page. The heading of your web page contains tags that work behind the scenes. The body section contains the actual content on your web page. (refer to web page structure handout) Copyright © Texas Education Agency, All rights reserved.7

8 Standard web page Structure and sections *See Handout Copyright © Texas Education Agency, All rights reserved.8

9 All tags should be written in lower case All values, anything after an equal sign, should be enclosed in quotes. All tags must be closed. HTML Grammar Copyright © Texas Education Agency, All rights reserved.9

10 DOCTYPE Tag Specifies the version of HTML or XHTML the document is written in. Should be placed above the opening HTML tag before a document is published online. There is no closing tag. Is written in upper case as shown (unlike other tags) Copyright © Texas Education Agency, All rights reserved.10

11 Open your text editor and type the following code: World Travel Save your file as index.htm to your Student Files folder. Copyright © Texas Education Agency, All rights reserved.11

12 Encapsulation HTML tags encapsulate (surround) the text that they are formatting. If more than one tag is formatting the text, then the closing tags should be written in reverse order from how they were opened. Text to Format Text to Format Copyright © Texas Education Agency, All rights reserved.12

13 Tag Specifications The body tag specifies where the page body begins and ends. By adding attributes to the body tag, you can make general specifications regarding your documents appearance, such as background color, text color, and your link colors. Attributes specify additional properties of a particular tag. Attributes are added to tags immediately after the tag name. They only need to be added to the opening HTML tag. Copyright © Texas Education Agency, All rights reserved.13

14 Basic Tags Paragraph Tags are indicated with the opening and the closing. Text in the form of blocks or paragraphs should be enclosed within the paragraph tags. Various formatting options can be added to the paragraph tag such as: align=“left” | “right” | “center” | “justify” Add paragraph here Copyright © Texas Education Agency, All rights reserved.14

15 Basic Tags Heading Tags are used for various one line headings on your document. The tag displays the largest text and the displays the smallest text. Text formatted with a heading tag is resized, bolded, and a line break is placed at the end of the line. Copyright © Texas Education Agency, All rights reserved.15

16 Open index.htm in your text editor and add the following code shown in orange. World Travel! World Travel is based out of the Dallas/Fort Worth Metroplex. We specialize in making travel arrangements for business travel, groups, and family vacations. We have over 20 years of experience in all areas of travel arrangements and can offer you the best in personal and friendly service. Copyright © Texas Education Agency, All rights reserved.16 NOTE: The blue code should already be typed. You should only be added the code shown in orange.

17 Preview Your Page World Travel World Travel is based out of the Dallas/Fort Worth Metroplex. We specialize in making travel arrangements for business travel, groups, and family vacations. We have over 20 years of experience in all areas of travel arrangements and can offer you the best in personal and friendly service. World Travel World Travel is based out of the Dallas/Fort Worth Metroplex. We specialize in making travel arrangements for business travel, groups, and family vacations. We have over 20 years of experience in all areas of travel arrangements and can offer you the best in personal and friendly service. Open your web browser (Internet Explorer, Firefox, etc) Click on File Select Open Navigate to where you saved index.htm and select the file to open. Copyright © Texas Education Agency, All rights reserved.17

18 Basic Tags Line Breaks are inserted into your web document using the tag. The web browser does not recognize white space, or when you press the ENTER key to move to a new line, therefore you must specify when you want to insert a line break in a web page. Line 1 Line 2 Line 3 Line 4 Line 1 Line 2 Line 3 Line 4 Copyright © Texas Education Agency, All rights reserved.18

19 Basic Tags Horizontal Rule tags draw a horizontal line, or divider, on your web page. Inserted by using the tag. Horizontal Rules do not have a corresponding ending tag because it just inserts a line. Horizontal rules will automatically apply a break at the end of the line. Copyright © Texas Education Agency, All rights reserved.19

20 Basic HTML Tags ~ Specifies the body content ~ Bolds Text ~ Underlines Text ~ Italicizes Text ~ Centers Text ~ Encloses paragraphs Inserts a line break Section Break Copyright © Texas Education Agency, All rights reserved.20

21 Open index.htm in your text editor and add the following code in orange after the closing tag. friendly service. Our Packages Include: Tour Arrangements Sporting Event Tickets Dinner Reservations Copyright © Texas Education Agency, All rights reserved.21

22 Return to your browser and click the Refresh button or press F5. Copyright © Texas Education Agency, All rights reserved.22

23 Tag Attributes An attribute is a feature that you can add to a tag that will allow you to modify the default features of the tag. For example: By adding the width attribute to the horizontal rule tag below, we are able to modify the width of the horizontal rule to only 50% of the page. To modify the thickness of the line, we will can use the size attribute. Copyright © Texas Education Agency, All rights reserved.23

24 Most attributes are not tag dependent and can be added to other tags. The align attribute can be applied to any of the Heading tags, the paragraph tags, horizontal rule tag, and many other tags that you will see later. When possible, its best to use attributes instead of additional tags. This text will be left aligned This text will appear centered This text will appear centered too Copyright © Texas Education Agency, All rights reserved.24 Align Attribute

25 Specifying Colors #000066#003399#336699#3366FF Colors can be specified by their name (blue) or by their RGB Color Code. RGB Color Code is a combination of 6 codes, the first two representing the intensity of red, the second two specifying the intensity of green, and the third two codes representing the intensity of blue. Below are some of the various shades of blue using RGB color code: EX: Copyright © Texas Education Agency, All rights reserved.25

26 Specifying Colors By adding the bgcolor attribute to the body tag, you can change the background color of your web page. To use the bgcolor attribute, apply it as shown below to the opening body tag: Your Web Page Your Web Page Copyright © Texas Education Agency, All rights reserved.26

27 Specifying Colors Copyright © Texas Education Agency, All rights reserved.27 By adding the text attribute to the body tag, you can change the default text color. To use the text attribute, apply it as shown below to the opening body tag: Your Web Page Your Web Page

28 Open index.htm in your text editor and add the code in orange: World Travel World Travel is based out of the Dallas/Fort Worth Metroplex. We specialize in making travel arrangements for business travel, groups, and family vacations. We have over 20 years of experience in all areas of travel arrangements and can offer you the best in personal and friendly service. Copyright © Texas Education Agency, All rights reserved.28

29 Preview index.htm once again in your browser. Notice the following: The background color has changed The heading “World Travel” is now underlined The Horizontal Rule is only 75% of the width and is two pixels in size. Copyright © Texas Education Agency, All rights reserved.29

30 Special Characters Web browsers will only recognize one space following a word or character, all others are ignored. For example, if you were to type a word and press the space bar five times, only the first space would be recognized by the browser. The browser assumes that the other spaces are part of the code layout and not part of the actual document. To add additional spaces to a web page, HTML includes a set of code called SPECIAL CHARACTERS. Copyright © Texas Education Agency, All rights reserved.30

31 Applying Special Characters HTML tags are created between the brackets Special characters are created between the & and ; characters. Special characters are the characters and symbols that are not on your keyboard, or that the browser would normally interpret as something else, or ignore. Copyright © Texas Education Agency, All rights reserved.31

32 Special Characters Space << >> ©© && "“ The table below lists some of the common special characters: Copyright © Texas Education Agency, All rights reserved.32

33 Complete Lab 1: Copyright © Texas Education Agency, All rights reserved.33

34 Copyright © Texas Education Agency, All rights reserved.34 Part 2 Creating Lists

35 Creating HTML Lists Lists are often used to present information in an easy to read format. There are three types of lists:  Bulleted, called Unordered Lists  Numbered, called Ordered Lists,  Definition Lists which are primarily used to set off and define terms. Copyright © Texas Education Agency, All rights reserved.35

36 Creating Unordered Lists An unordered list creates bullets before each item in the list. To create an unordered list, you should place the and tags around the entire list. Each item in the list should be preceded with the ~ tag. Copyright © Texas Education Agency, All rights reserved.36

37 Unordered List Example Stages of Web Site Management Planning Stage Site Design Stage Update and maintenance Stage Stages of Web Site Management Planning Stage Site Design Stage Update and maintenance Stage Notice that and indicates the beginning and end of the list. The ~ tags encapsulates each item in the list and inserts bullets. Copyright © Texas Education Agency, All rights reserved.37

38 Ordered List Example Stages of Web Site Management Planning Stage Site Design Stage Update and maintenance Stage Stages of Web Site Management 1.Planning Stage 2.Site Design Stage 3.Update and maintenance Stage Copyright © Texas Education Agency, All rights reserved.38

39 List Attributes AttributeExample of UseAvailable Values type (Unordered List) disc | circle | square type (Ordered List) I | i | 1 | A | a | start Any numeric value The type attribute, when applied to the unordered list, allows you to change the bullet style. The default first level bullet is the disc. Copyright © Texas Education Agency, All rights reserved.39

40 We will now continue with the sample travel website. Open index.htm in your text editor. Copyright © Texas Education Agency, All rights reserved.40

41 REPLACE the following code in orange: Our Packages Include: Tour Arrangements Sporting Event Tickets Dinner Reservations Our Packages Include: Tour Arrangements Sporting Event Tickets Dinner Reservations Copyright © Texas Education Agency, All rights reserved.41

42 Refresh the document in your browser. Copyright © Texas Education Agency, All rights reserved.42

43 Our Packages Include: Tour Arrangements Sporting Event Tickets Dinner Reservations Return to your code and change the opening and closing tags to. Copyright © Texas Education Agency, All rights reserved.43

44 Resave and preview your document in the browser. The numbers should have changed to bullets. Copyright © Texas Education Agency, All rights reserved.44

45 Our Packages Include: Tour Arrangements Sporting Event Tickets Dinner Reservations Return to your code and add the attribute shown in orange to the opening tag. Copyright © Texas Education Agency, All rights reserved.45

46 Resave and preview your document in the browser. The bullets should change to circles. Copyright © Texas Education Agency, All rights reserved.46

47 Definition List The definition list does not use bullets or numbers, but uses indentions. The term, or work being defined, is indicated by the tag and has no indentions. The definition, indicated by the tag is indented under the term. The entire definition list should be surrounded with the and the tags. Copyright © Texas Education Agency, All rights reserved.47

48 Web Site Structures Linear All pages are organized in a line Good for small instructional sites Hierarchical Resembles a pyramid Good for organizing large web sites Random Pages are randomly linked Good for small sites Sample definition list code structure. Copyright © Texas Education Agency, All rights reserved.48

49 Web Site Structures Linear All pages are organized in a line Good for small instructional sites Hierarchical Resembles a pyramid Good for organizing large web sites Random Pages are randomly linked Good for small sites Sample definition list browser view. Copyright © Texas Education Agency, All rights reserved.49

50 Nested Lists A nested list is created when you place a sub-list inside of another list. An outline could be considered a nested list. When creating a nested list, the sub-list must be opened and closed below the listed item of the main list. If the sub-list is not closed, the browser will not know where the nested list ends and the main list continues. Copyright © Texas Education Agency, All rights reserved.50

51 Planning Your Site Who will be viewing your site? What information will your site provide? Designing Your Site What color scheme will be used? Design the template Update and Maintenance of Site Keep site updated with current information Add or remove pages as necessary Copyright © Texas Education Agency, All rights reserved.51

52 I.Planning Your Site oWho will be viewing your site? oWhat information will your site provide? II.Designing Your Site oWhat color scheme will be used? oDesign the template III.Update and Maintenance of Site oKeep site updated with current information oAdd or remove pages as necessary Nested List Output Copyright © Texas Education Agency, All rights reserved.52

53 Complete Lab 2: Copyright © Texas Education Agency, All rights reserved.53

54 Part 3 Creating Links Copyright © Texas Education Agency, All rights reserved.54

55 Review of Web Site Structures Hierarchical Site Structure Random Site Structure Linear Site Structure Diagrams used with permission from Copyright © Texas Education Agency, All rights reserved.55

56 Creating Links Links allow visitors to move from one page of the web site to another. A basic link on a web page will open a new page when clicked. Links are created with the anchor tag which is indicated as. The anchor tag itself does not do anything, you must add the href attribute to the anchor tag for it to create a link. Copyright © Texas Education Agency, All rights reserved.56

57 Creating Links The href attribute should be set equal to the location and file name of the page you want to open. Menu Links must include a corresponding closing anchor tag with the text you want to click on between the opening and closing anchor tags. Copyright © Texas Education Agency, All rights reserved.57

58 Link Example Click here to go to page 2 Copyright © Texas Education Agency, All rights reserved.58

59 Linking to Other Web Sites To open a page on another web site, you must include in front of the web site address. UNT Copyright © Texas Education Agency, All rights reserved.59

60 Modifying Link Properties All links are underlined, and unless you specify otherwise, all links will be blue. While you are clicking on the link, the color changes red, and after the link has been visited, its color changes to violet. To change the colors of the links on a web page, add the link, vlink, and alink attributes to the body tag. Copyright © Texas Education Agency, All rights reserved.60

61 AttributeDescription link=“red” Modifies the default color of the link on a document. vlink=“green” Modifies the color of links that have already been visited. alink=“yellow” Modifies the color of the active links currently selected. Modifying Link Properties Copyright © Texas Education Agency, All rights reserved.61

62 . Dinner Reservations New York City Texas California Open index.htm in your text editor and add the following code shown in orange: Copyright © Texas Education Agency, All rights reserved.62

63 Refresh your document in the browser. Copyright © Texas Education Agency, All rights reserved.63

64 New York City Opening Links in a New Window The target attributed can be used to direct links to open in specific locations. Targeting a link to open in top or blank will cause a link to open in a new browser window. The target attributed will be looked at again in the frames lesson. Copyright © Texas Education Agency, All rights reserved.64

65 Creating an Link An link will open the viewer’s program and place the address that you indicated in the TO section. To create an link, the mailto: statement must immediately follow the href and precede the address. Copyright © Texas Education Agency, All rights reserved.65

66 Creating an Link Follow the code sample shown below. The link shown below will open the default program installed on your computer. Me Copyright © Texas Education Agency, All rights reserved.66

67 Creating a Page Jump A page jump is a link that does not open a new page, but moves to another par of the current page. It requires two parts, an anchor tag to be used as a section marker to identify the section name of the page where the link should go, and the link to jump to the named section. To name a section, you place the anchor tag with the NAME attribute in the spot where you want the user to go when they click the page jump link. Copyright © Texas Education Agency, All rights reserved.67

68 Creating a Page Jump To create the page jump link, you just set the link where you want to add the page jump. Set the href attribute to the name of the section of the page preceded with the # sign. Go to the top of the page Copyright © Texas Education Agency, All rights reserved.68

69 Complete Lab 3: Copyright © Texas Education Agency, All rights reserved.69

70 Part 4 Text & Fonts Copyright © Texas Education Agency, All rights reserved.70

71 Font Tag Changing the style of the font is accomplished using the tag. You enclose the content you wish to format in between the opening and closing tag. The font attributes include: face, size, color. Copyright © Texas Education Agency, All rights reserved.71

72 Font Face The default font face style for most browsers is "Times New Roman". There are five basic font classifications, Serif Sans Serif Script, Fancy Monospace IMPORTANT POINT: Just because you have a particular font on your computer, that does not mean everyone else who visit your site has that same font. Copyright © Texas Education Agency, All rights reserved.72

73 Font Face An example of basic font faces: Other common font faces: This is Serif This is Sans Serif This is Script This is Monospace Times New Roman Cosmic Sans MS Impact Courier New Tahoma Broadway Haettenschweiler Stencil Wide Latin Lucida Handwriting Playbill Algerian Arial Britannic Bold Arial Black Bookman Old Style Verdana Colonna MT Copyright © Texas Education Agency, All rights reserved.73

74 Available fonts YOUR computer can read may be different that other computers! C:/windows/fonts Copyright © Texas Education Agency, All rights reserved.74

75 Font Size The font tag may also be used to change the font size of text by adding the size attribute There are only 7 font sizes available with 1 being the smallest, and 7 being the largest. Copyright © Texas Education Agency, All rights reserved.75

76 Font Size An example of font size: Size 1 Size 2 Size 3 Size 4 Size 5 Size 6 Size 7 Copyright © Texas Education Agency, All rights reserved.76

77 Font Color The color attribute is added to the font tag to change the color of a block of text To assign colors, the color name of a basic color, or the RGB color code may be used. This is red! Copyright © Texas Education Agency, All rights reserved.77

78 Open index.htm from your Student Files folder and add the code shown in orange: World Travel : California Copyright © Texas Education Agency, All rights reserved.78

79 Preview index.htm once again in your browser. The page is now much easier to read. It is important to choose your colors carefully so that the viewer can read the text easily. Copyright © Texas Education Agency, All rights reserved.79

80 Copyright © Texas Education Agency, All rights reserved.80 Complete Lab 4:

81 Part 5 Adding Images Copyright © Texas Education Agency, All rights reserved.81

82 Image Formats There are many types of image formats. The two you will most likely use are the gif and jpg formats. gif (Graphics Interchange Format) limited to 256 colors, one color can be transparent, gif images can be animated. jpg (Joint Photographic Experts Group) Can display millions of colors. Typically used for photographs. Can not include a transparent color or be animated. Copyright © Texas Education Agency, All rights reserved.82

83 Inserting Images The image tag should close itself. The file extension of the image MUST be included after the image name. Copyright © Texas Education Agency, All rights reserved.83

84 World Travel Copyright © Texas Education Agency, All rights reserved.84 Open index.htm from your Student Files folder and make the changes indicated below.

85 Copyright © Texas Education Agency, All rights reserved.85 Preview index.htm once again in your browser.

86 Aligning Images The image is to the right with text wrapping to its left The image is to the left with text wrapping to its right Copyright © Texas Education Agency, All rights reserved.86

87 This image has not been aligned so it is applied inline with the text. This image has been aligned to the left, therefore text will wrap around the image. Copyright © Texas Education Agency, All rights reserved.87

88 in personal and friendly service. Add the following orange code to index.htm where indicated below the horizontal rule tag. Copyright © Texas Education Agency, All rights reserved.88

89 The second image should be aligned to the right side of the screen with the text wrapping along the left side of the image. Copyright © Texas Education Agency, All rights reserved.89 Preview index.htm once again in your browser.

90 Section Breaks Section Breaks on a web page are line breaks with the clear="all". A section break on a web page is like a continuous section break in a word processor. Primarily used to STOP text from wrapping around an image. Copyright © Texas Education Agency, All rights reserved.90

91 Image Attributes src – specifies the image file align – defines image alignment hspace – horizontal spacing vspace – vertical spacing width – width of an image height – height of an image alt – text alternative of an image Now that you know how to work with images, there are other attributes available to help customize their appearance. Copyright © Texas Education Agency, All rights reserved.91

92 hspace & vspace Will add a margin spacing to the left and right and/or top and bottom of an image. Helps prevent a webpage from appearing cluttered and crowded. Copyright © Texas Education Agency, All rights reserved.92

93 width & height Can be applied to an image to specify a specific image size. Should be used to make small adjustments only. Use only one to keep the image in proportion. Copyright © Texas Education Agency, All rights reserved.93

94 Text Alternatives A line of text that will appear when your mouse is placed over the image. If the image does not load, the text will appear in place of the image. Applied to the img tag using by the alt attribute. Copyright © Texas Education Agency, All rights reserved.94

95 Complete Lab 5: Copyright © Texas Education Agency, All rights reserved.95 Home Page

96 Complete Lab 5: Copyright © Texas Education Agency, All rights reserved.96 Statue of Liberty Page

97 Complete Lab 5: Copyright © Texas Education Agency, All rights reserved.97 Empire State Building

98 Complete Lab 5: Copyright © Texas Education Agency, All rights reserved.98 Central Park


Download ppt "Copyright © Texas Education Agency, 2013. All rights reserved.1 Web Technologies Introduction to HTML Scripting."

Similar presentations


Ads by Google