1 / 46

HTML

HTML . Hyper Text Markup Language A simple introduction. Agenda. What is HTML? Basics Tools Important tags Tables & databases Forms Publishing at Stern. What is HTML?. HTML stands for Hyper Text Markup Language

jfarnum
Télécharger la présentation

HTML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTML Hyper Text Markup Language A simple introduction

  2. Agenda What is HTML? Basics Tools Important tags Tables & databases Forms Publishing at Stern

  3. What is HTML? • HTML • stands for Hyper Text Markup Language • It allows a user to “markup” a text document to indicate how one might want different parts displayed by a web browser.

  4. The Basics HTML documents contain “tags” which instruct the Browser software on how to present the information within a tag. These are called “styles” Styles can be imbedded within styles <bold><h1> TEXT </h1></bold> Tags begin with <tag> and end with </tag>

  5. Adding Hypertext The <a> (anchor) tag This tag is used for a clickable element which is a link to another document (or another location within the current document) Documents can be located on any web server on the internet A hypertext reference looks like <a href=“http://www.stern.nyu.edu/~nwhite”> My home page </a>

  6. Creation Tools Unix Pico editor Vi Emacs Windows Notepad Word Bbedit Dreamweaver Front Page

  7. Why do we need to know HTML? There are many tools that will generate reasonable looking web sites However, you usually need to know HTML in order to connect your web page to a data base

  8. Easiest Tools Unix Pico cd public_html pico file.htm chmod o+r file.htm (makes it readable by the web server) Windows (need to move file to websys3) Notepad Word (add new ftp location to publish) Sea Monkey http://en.wikipedia.org/wiki/Comparison_of_HTML_editors

  9. Advanced ToolsWe will use Dreamweaver Dreamweaver Handles Frames, Forms, Tables etc. Generates Javascript behaviours Handles site management details Broken links, publishing etc. Works with Flash and Fireworks Latest version Supports HTML5 Also supports mobile devices

  10. A Simple Document <html> <head> <title> This is the Title </title> </head> <body> This is the body of the page<p> And here is some more </body> </html>

  11. HTML BasicsImportant Tags Anchor statement <a href=“URL” options> Text to display </a> Examples <a href=“myfile.htm” >Click here for myfile </a> <a href=“myfile.htm” align=center> Click here for myfile</a> <a href=“myfile.htm” target=mainwindow> Click here for myfile </a> Things to remember Links are relative to current folder if not fully specified I.e. “websys/myfile.htm” means the myfile.htm file in the folder named websys underneath the current folder Good idea to use relative addresses whenever possible, then you can move complete sites around easily

  12. The IMG tag <IMG SRC=“myimage.gif”> Options <IMG SRC=“myimage.gif” alt=“this is my picture”> <Img src=“myimage.gif” map=mapname> <img src=“myimage.gif” height=200 width=100> <img src=“http://www.stern.nyu.edu/images/nyu.gif” align = left>

  13. Other interesting tags <table> Use to define multicolumn tables Useful for aligning items Easy to make and very flexible Example

  14. Sample Table <table> <tr> <td> cell 1 row 1</td> <td> cell2 row 1 >/td> </tr> <tr> <td><img src=“..”> </td> <td> <img src=“…” </td> </tr> </table>

  15. Tables and Databases Since relational data bases are stored in tables, and the result of any relational query is also a table, guess what, we tend to display data base results as HTML tables. Actually, this is outdated, now we use divs… But that is jumping ahead, first we need to understand the Common Gateway Interface (CGI) model and other related server side solutions. We will talk about that in a few sessions.

  16. Advanced tags Frames Forms Layers …

  17. Forms A form allow users to enter data through a web page so it can be processed by a program on a server Forms and tables are the two necessary ingredients for web enabled databases

  18. Form Types TEXT RADIO CHECKBOX LIST MENU COMBOBOX SCROLLBAR …

  19. Conclusion HTML is pretty simple Knowledge of a few tags can get you a long way.. Have fun… So let’s publish a web page.

  20. Publishing Hypertext Need to move it to web server (computer) and place in a location the web server program can read it You need to give the WEB server program read access to the directory and page(s), since the program runs under a different userid (than yours).

  21. Publishing at Stern Dreamweaver (This is what we will use throughout the course) Notepad

  22. Stern File ServersYour files are shared across several servers:pages.stern.nyu.edu (the student web server)andwebsys3.stern.nyu.edu(the class unix machine.)You can only login to sales and websys3.

  23. Stern File System All files in one place websys3 WWW Pages Web Server Sales Home Directories /homedir/grad/…

  24. File System Standards All grad student home directories are at: /homedir/grad/fchar/userid Where fchar is the first character of your userid Undergrad files are at: /homedir/ugrad/fchar/userid But web pages are in …/userid/public_html (why??)

  25. Publishing You need to use the following address for publishing sftp://websys3.stern.nyu.edu/TheAddressOfYourPage I.e. sftp://websys3.stern.nyu.edu/homedir/grad/e/ep5/public_html Where “homedir/grad/e/ep5/public_html” is the output of the pwd command you issued But you can view it at http://www.stern.nyu.edu/~userid/filename.html http://pages.stern.nyu.edu/~userid/filename.html For this class, I would like you to put all of your files in a websys folder in your public_html directory.

  26. Editing HTML in Dreamweaver You can either buy Dreamweaver in the bookstore, or run it from the Stern APPS server. The advantage of buying it is that it will keep all of your settings from one session to another. But, we will use Dreamweaver on apps for examples. If you are budget constrained, you can use APPS for the first part of the course, and then download a demo version of Dreamweaver that will run for 30 days. You can also buy a Dreamweaver academic license by the month

  27. For more info Let’s try to create a web page…

  28. More Details • First • ssh to websys3.stern.nyu.edu (from PUTTY) • Login with your stern userid and password • This should create a home directory for you. • Then type “cd public_html” • Type “mkdir websys” • Type “exit” • Second • Go to http://apps.stern.nyu.edu with your web browser • Third • Click on Dreamweaver (it takes a while to start)

  29. Click on Dreamweaver

  30. Click on Site

  31. Click on Site, add a new site

  32. Put local copy in your H drive, Click Save

  33. Click on the + to add a server

  34. You now should be able to use Dreamweaver to create a web page. The default web page is usually “index.html”. It will be displayed when you go to a location and don’t specify a file name. You can create your own home page at Stern by putting an index.html file in your public_html directory. But we don’t want to put one in your websys directory, so that we can list it’s contents for grading.

  35. Next, we click on File, New in Dreamweaver and create a file. Dreamweaver can show us both what the web browser will display, as well as what the html code is if we click on the “split” tab.

  36. The click on save as And call it Page1

  37. Now we are ready to publish to the web server If we click on the UP ARROW, it should move files to the web server where we can see them with a web browser.

  38. Your Homeworks Please put all of your homeworks in the websys folder so we can find them. Name them hw1.htm, hw2.htm etc. Do NOT put an index.html file in that folder. It will hide your homeworks from us. If you wish, you can use Dreamweaver to put an index.html file in the public_html folder, and then you will have your own web page. To do that, create another site and make the root directory public_html

  39. You should now be ready to work

More Related