HTML Intermediate


Published on

Published in: Technology, Design
  • Be the first to comment

HTML Intermediate

  1. 1. HTML Lesson 1 January 2004 Information Processing
  2. 2. Introduction <ul><li>This lesson is going to show you how to write your own HTML using only windows notepad. It's just as easy as learning to use a &quot;publisher&quot;, and you will have far more control over your pages and how they look. </li></ul>
  3. 3. Step 1: Create a place on your hard drive to save your work <ul><li>Your web page will consist of text documents created and saved in notepad with the extension .html, and graphic images (clip art and photos) with the extensions of .jpg or .gif. All of these items need to live in the same folder on your hard drive, so let's make that home for them first: </li></ul><ul><li>On your desktop, double-click and open &quot;My Computer&quot; </li></ul><ul><li>Double-click and open drive C (or whatever your hard drive is named) </li></ul><ul><li>Right-click somewhere in the box in an open space to bring up a pop-up menu. Choose: New --> Folder. </li></ul><ul><li>Type a name for the new folder, something like &quot;webpage&quot;. </li></ul>
  4. 4. Step 2. Put a few graphics in this folder <ul><li>Any graphic images that you have and want on your web page need to be moved to this new folder. Move the sample picture there now and write down its name for later easy reference: </li></ul><ul><li>Example names: myphoto.jpg quackers.gif </li></ul>
  5. 5. Step 3. Begin your first page <ul><li>Open notepad. (Start --> Programs --> Accessories --> Notepad ) (not Wordpad!) Type only the red items, including the angle brackets, exactly as shown: </li></ul><ul><li>Type: <html> Hit enter and skip down a line or two. </li></ul><ul><li>Type: <head> Hit enter. </li></ul><ul><li>Type: <title>My First Webpage</title> Hit enter. </li></ul><ul><li>Type: </head> Hit enter and skip down a line or two. </li></ul><ul><li>Type: <body> Hit enter and skip down a line or two. </li></ul><ul><li>Type a sentence or two of your choice, something like: Welcome to my first web page. I am thrilled to be learning html. </li></ul><ul><li>Skip several lines and then type: </body> </li></ul><ul><li>Hit enter and type: </html> </li></ul>
  6. 6. A NOTE on what you are doing: <ul><li>The left and right angle brackets < > create a TAG. </li></ul><ul><li>A tag is simply an instruction to your browser that tells the browser how you want the text or image between the tags to appear on the page. </li></ul><ul><li>The angle-brackets themselves, and the instruction between them, will not be visible on the actual web page. </li></ul><ul><li>Most tags are used in pairs: an opening tag < > and a closing tag < / >. </li></ul><ul><li>You will place opening tags and closing tags in your document to tell the browser where you want a certain effect such as bold, underline, and colors, to begin and end. </li></ul><ul><li>Although most of the time you will select the tags you want to create the effects you want, the tags shown in Step 3 (html, head, title, and body) are required tags in every html document, as they instruct the browser that this is an html page. </li></ul>
  7. 7. If you've been following the instructions exactly, you should now be looking at an untitled notepad document that looks something like this <ul><li>untitled - Notepad </li></ul><ul><li>________________________________________________________ </li></ul><ul><li><html> </li></ul><ul><li><head> </li></ul><ul><li><title>My First Web Page</title> </li></ul><ul><li></head> </li></ul><ul><li><body> </li></ul><ul><li>Welcome to my first web page. </li></ul><ul><li>I am thrilled to be learning html. </li></ul><ul><li></body> </li></ul><ul><li></html> </li></ul>
  8. 8. Step 4: Save this document to your webpage folder <ul><li>In the notepad window, click: File --> Save as The &quot;save as&quot; window will open. </li></ul><ul><li>Find your webpage folder: In the &quot;save in&quot; field, click the down arrow and locate drive C, (or whatever drive you made your webpage folder in). The contents of drive C will appear in the big box below the &quot;save in&quot; field. Locate your webpage folder and double-click it. It should now appear in the &quot;save-in&quot; field. </li></ul><ul><li>In the &quot;filename&quot; field, type: index.html (note: you MUST name the first page &quot;index.html&quot;) </li></ul><ul><li>In the &quot;save as type&quot; field, select: &quot;All files(*.*)&quot; </li></ul><ul><li>Hit enter or click save. </li></ul><ul><li>Obviously, notepad is not a WizzyWig editor, but that is not a problem. Next we will learn how to view and edit your actual page. </li></ul>
  9. 9. Step 5: View your actual web page <ul><li>If you have saved your document as index.html (confirm that by checking the title bar of the document - it should now say &quot;index.html - Notepad&quot;. If it doesn't, redo step 4) then: </li></ul><ul><li>Go ahead and close notepad. (File-->Exit) </li></ul><ul><li>Open your webpage folder. (My computer --> C: --> webpage) </li></ul><ul><li>Find &quot;index.html&quot; and double-click it. Assuming you have Microsoft Internet Explorer (MIE), it will open and display your page. Of course, there's not much to see there yet. </li></ul>
  10. 10. It will look something like this: <ul><li>My First Web Page - Microsoft Internet Explorer </li></ul><ul><li>___________________________________  </li></ul><ul><li>Welcome to my first web page. I am thrilled to be learning html. </li></ul>
  11. 11. Step 6: View the source and edit your page: <ul><li>Somewhere in the empty space of the browser window, right click, and then select &quot;view source&quot; from the pop-up menu. </li></ul><ul><li>&quot;Index.html - notepad&quot; re-opens! </li></ul><ul><li>Now you have both windows open (notepad and MIE). In notepad, you edit the page, and in MIE, you get to see your work. You'll create your entire page this way, offline. To make things easy, move and position these two windows so you can see a portion of both (don't have their size maximized) because we're going to be doing a lot of clicking back and forth between them. </li></ul>
  12. 12. Step 6: View the source and edit your page (continued) <ul><li>4. Let's learn 2 new tags and see the results: In notepad, we're going to instruct the browser to separate and center your sentences on the page. Add the tags shown in red below to your sentences in notepad. <center> Welcome to my first web page. <br> I am thrilled to be learning html. </center> </li></ul>
  13. 13. Step 6: View the source and edit your page (continued) <ul><li>5. We must save these changes. You must re-save the document every time you make any kind of change. In the upper-left corner of notepad, click: File -->Save. </li></ul><ul><li>6. Every time you save a change, you must refresh your browser window to see the change. Somewhere in the empty space of the browser window page, right click, and then select &quot;refresh&quot; from the pop-up menu. </li></ul>
  14. 14. Your revised web page should now look like this: <ul><li>My First Web Page - Microsoft Internet Explorer </li></ul><ul><li>_____________________________________ Welcome to my first web page. I am thrilled to be learning html. </li></ul>
  15. 15. Note on the 2 new tags: <ul><li>The center tag is self-explanatory, but you must remember to use both the open-center and the close-center tags, as any information between these two tags will be affected. </li></ul><ul><li>The break tag < br > is one of a few stand-alone tags (i.e., it doesn't need closing), and it forces a line break. </li></ul><ul><li>You can hit &quot;enter&quot; or &quot;space bar&quot; all you want - it won't change the page's appearance. Browsers don't recognize blank lines or spaces. The only way to format the appearance of your page is to type in the tag that will give your browser the appropriate instruction. </li></ul>
  16. 16. Step 7: Add a graphic image <ul><li>We're going to add to the page, one of the graphic images you moved to the webpage folder in step 2. I'll use the example names. You'll use your actual graphic image names. We're going to skip a line, and center the image right under your text. </li></ul><ul><li>In notepad, place your cursor after the </center> tag and hit &quot;enter&quot;. Type: <br> </li></ul><ul><li> <center><img src=“quackers.gif”><center> </li></ul>
  17. 17. Step 7: Add a graphic image (continued) <ul><li>3. Replace your own image name for quackers.gif and make sure you include the quotation marks. You must type the name of the image exactly as it appears in your webpage folder. Tags are not case-sensitive, but image and file names are. You might want to use all lower-case in your file names, just to avoid conflict problems. </li></ul>
  18. 18. Your notepad document should now look like this: <ul><li>index.html - Notepad ___________________________________________________________________________<html> </li></ul><ul><li><head> </li></ul><ul><li><title>My First Web Page</title> </li></ul><ul><li></head> </li></ul><ul><li><body> </li></ul><ul><li><center>Welcome to my first web page.<br> I am thrilled to be learning html. </li></ul><ul><li><center> </li></ul><ul><li><br> </li></ul><ul><li><center><img src=“quackers.gif”></center> </li></ul><ul><li></body> </li></ul><ul><li></html> </li></ul>
  19. 19. Step 7: Add a graphic image (continued) <ul><li>You've learned another tag: image source < img src= > , used to specify the image you want to place on your page. This one also doesn't need a closing tag. </li></ul>
  20. 20. Step 7: Add a graphic image (continued) <ul><li>4. Save notepad, then switch to your browser window and refresh. The graphic image will appear, and it should be centered, as in the example below: </li></ul>My First Web Page - Microsoft Internet Explorer _____________________________________ Welcome to my first web page. I am thrilled to be learning html.
  21. 21. If your graphic image doesn't appear, don't panic, you've probably made one of the errors below: <ul><li>You have named a graphic that is not in the same folder (webpage) as where you saved the index.html page. Move the graphic into the same folder. </li></ul><ul><li>You've got the wrong extension name - you typed .jpg, but the image is a .gif (or vice versa). Correct the extension name in the image source tag. </li></ul><ul><li>You've got a possible lower case/upper case conflict. As explained above, file names are case-sensitive. </li></ul><ul><li>You've made a typo. Maybe you've made a spelling error, included a space where there shouldn't be one, or omitted an angle bracket or a quotation mark. Go back and proof your document carefully. </li></ul><ul><li>You forgot to &quot;save&quot; in notepad or &quot;refresh&quot; MIE. </li></ul>
  22. 22. Today’s Classwork Grade <ul><li>Leave your page open in the browser so that I can come around and grade it. </li></ul><ul><li>I will grade: </li></ul><ul><ul><li>Title of your page (25 points) </li></ul></ul><ul><ul><li>Centered text (25 points) </li></ul></ul><ul><ul><li>Line break (25 points) </li></ul></ul><ul><ul><li>Picture (25 points) </li></ul></ul>
  23. 23. Step 8: Upload your page to the web: <ul><li>Sign on to AOL </li></ul><ul><li>Go to keyword: my ftp space. The My FTP Space window opens. </li></ul><ul><li>Click: See My FTP Space (If you get a Hometown AOL pop-up, close it. You're an html-writer now, you don't need that wussy thing.) A window named &quot; screen name)&quot; will appear. In the window, it will say Connected to Bookmark this if you want, this is your ftp place. You will upload your files onto the internet from here. </li></ul><ul><li>Notice the row of buttons in the bottom of the window. Click on &quot;upload&quot;. A new window appears. </li></ul><ul><li>In AOL, you must upload each text file and graphic individually. Notice the &quot;transfer mode&quot; radio buttons. We're going to upload your index.html file first. Select ASCII. All your html text documents are ASCII. </li></ul>
  24. 24. Step 8: Upload your page to the web (continued) <ul><li>6 . In the &quot;Remote filename&quot; field, type: index.html Double-check you have ASCII selected, then click continue. </li></ul><ul><li>A new window named &quot;upload file&quot; appears. Click &quot;select file&quot;. </li></ul><ul><li>The &quot;Attach File&quot; window opens. You can now use the down arrow of the &quot;look in&quot; field to browse your hard drive and find your index.html file. (C: --> webpage --> index.html) Double-click the file name (index.html) You're back to the &quot;upload file&quot; window, and the name and location of your index.html file should be shown in the &quot;file&quot; field . Click &quot;Send&quot;! The upload should happen fairly instantly, since this is such a small file. When it's done, click &quot;ok“ </li></ul><ul><li>We're now going to upload your graphic image: In the &quot;Remote filename&quot; field, type: quackers.gif (But you will use the name of your image, of course.) Select the &quot;Binary&quot; radio button. All graphic images are Binary. Click &quot;continue&quot;, and then follow steps 8.7 and 8.8 above, to locate and send your graphic image. Click ok when done. </li></ul><ul><li>Close all those ftp windows. We're going to go look at your webpage now! </li></ul>
  25. 25. STEP 9: Find your page online <ul><li>Your URL is: </li></ul><ul><li>Type your URL in the keyword field, and hit enter. (Of course, you'll put your screen name (no spaces) in place of yourscreenname. You knew that, didn't you?) Also, you don't need the &quot;http://&quot; in the keyword field. It's assumed. </li></ul>
  26. 26. STEP 9: Find your page online (continued) <ul><li>2. Your page should open. If it doesn't, if you get the message &quot;not found&quot; or &quot;directory of index.html&quot;, you will need to repeat the upload steps. If re-uploading becomes necessary: You just need to reload what's not showing. If you get one of the messages above, or a page of &quot;hieroglyphics&quot; you need to reload your index.html. If your page opens, but you don't see the graphic, you need to reload the graphic. </li></ul>
  27. 27. STEP 9: Find your page online (continued) <ul><li>Again, the ftp place is super case-sensitive, so pay attention. If in your webpage folder, your graphic is named myphoto.jpg , and in your index.html document you type myphoto.JPG and in the ftp remote filename field you type Myphoto.jpg , it ain't gonna happen. All you'll get is a picture of a nice X ! </li></ul><ul><li>Other than that, it's probably not your fault. Uploads in AOL often fail - I don't know where the document or image goes (it must be floating around in cyberspace somewhere) but occasional upload &quot;redo's&quot; is just something in AOL you have to deal with. </li></ul>
  28. 28. IMPORTANT REMINDER: <ul><li>Your browser stores a copy of recent pages you have visited, for the purpose of being able to load them faster if you should visit them again. Therefore, as you begin to build and upload your actual web page, after any edit, revision or upload, don't forget to right-click and refresh your actual online page, or you may be viewing the old page as stored in your cache, instead of the revised page with all your changes! </li></ul>
  29. 29. Now you’re ready for lesson 2! <ul><li>We have learned the very basics of how to create a web page and upload it to the internet, using notepad, AOL and MIE. Granted, the page we made is pretty boring, and I know you'll want to learn the tags that will add color, backgrounds, different fonts, hyperlinks, etc. etc. </li></ul><ul><li>Now that you know the basics, you will have no trouble learning more html tags to dress up your page. When you're ready, Part 2 will walk you through a number of additional tags and techniques. </li></ul>