Preparing Web Pages - HTML Preparing Web Pages with HTML Nancy McCracken NPAC Syracuse University 111 College Place Syracuse NY 13244-4100 May 1996 Click here for body text Preparing Web Pages with HTML HTML stands for HyperText Markup Language. It is defined using SGML (Standard Generalized Markup Language) and provides tags to identify document structure for later formatting and links to other documents. This presentation will cover the most commonly used or important features of HTML; more details can be found in the references. Topics will include formatting text on a web page and creating links to other web pages using images and imagemaps creating forms creating tables creating frames Features will be included from both HTML2.0 and HTML3.0, and the enhancements from the Netscape 1.1 and Netscape2.0 browsers. References: HTML and CGI Unleashed, John December and Mark GInsburg. http://www.netscape.com/toc.html - Various documents on html features, under the Assistance section of this Table of Contents from Netscape. HyperText Markup Language (HTML) is the formatting language used for creating hypertext documents on the World Wide Web, which can be displayed by Web browsers (sometimes referred to as viewers) such as Mosaic. HTML is very simple - a minimum of formatting functions consists of formatting commands called tags in a text file tags are in < > brackets most are paired for beginning and end:
, which has extra blank lines. Every year we stock thousands of rugs in all patterns which we obtain in our annual rug-buying expeditions to the markets of the Middle East.
. . . Formatting a Web Page: Lists HTML can format three types of lists: an ordered list
for preformatted andwhich also indents. "Trust your browser": Logical Styles: , , and typically displayed in italics.,, typically displayed in fixed-width font. typically displayed in bold. Physical Styles: bold italic typewriter - fixed-width font Escape sequences for characters used for tags < for < > for > & for & " for " Additional escape sequences support special characters, such as ® for the Registered Trademark symbol and © for the Copyright symbol. Formatting a Web Page: Miscellaneous Topics There are tags for centering text within the window:
Oriental Rug Company For a really startling effect, not particularly recommended!, there is a tag for blinking text. To separate areas of your web page, there is a horizontal line,
, which draws a line the width of the current window. This tag also has attributes to control the appearance and placement of the line:
gives the thickness of the line in pixels
specifies the width of the line either by the number of pixels or by a percentage of the current window
is the placement of the line
Comments can be given in the html file. Formatting a Web Page: Another way to specify larger and smaller sizes of text, is to give font size. where value is from 1 to 7 to increase current size by 1 The default size is 3. Of course, this is all relative to the sizes chosen by the browser. A Netscape 2.0 enhancement: where each pair HH of hexadecimal digits specifies a number. The three numbers are taken as Red, Green and Blue in the RGB color representation. Another Netscape 2.0 enhancement is providing tags for subscripts and superscripts and . Formatting a Web Page: Backgrounds A nice feature in controlling the appearance of your web page (aren't you tired of so-called "Mosaic gray"?) is being able to design the background. This is done either by giving a plain color or by supplying an image to use for the background. Backgrounds are specified as an attribute to the tag. where the URL refers to an image. Note that this image can be small - it will just be repeated as necessary to fill the browser window. Many image files suitable for backgrounds are found at the web site http://www.netscape.com/assist/net_sites/bg/background.html Other attributes can specify colors for links. Completing your Web Page You should always add your address to the bottom of any HTML page you create, so people know how to contact you with questions or comments. There is an address tag for this, which just puts the text in italics. Usually people separate this from the rest of the text by a horizontal line.
This page maintained by the staff of the Oriental Rug Co., Learbury Building, Syracuse NY. Please send comments to oriental@aol.com. Or you can use the convenient "mailto" feature: Please send comments to oriental@aol.com. People often put a copyright symbol, or an anchor to a copyright notice here. (Copyright issues are still being debated.) If the page has information that changes frequently, you may wish to put a notice "Last updated on 1/5/95". Inlined Images Browsers such as Mosaic and Netscape allow you to include images inbetween lines of text. The image must be in GIF format. (Netscape now allows inlined JPEG images.) Suppose that we make a banner for our company that includes the name in a GIF image. Then we can replace our original plain text header with the image: Only the SRC attribute of the image is required. ALT is optional and gives alternate text for text-based viewers such as Lynx which cannot show the image. The attribute BORDER=value tells the width of the picture border in pixels (this is blue if the image is a link). The VSPACE=value and HSPACE=value attributes specify the numbers of pixels of blank space to surround the image. Another attribute is ALIGN=top|texttop|middle|absmiddle|baseline|bottom|absbottom. If there is any text after the picture which can fit on the formatted page besides the picture, this will say how to place it. The default is "bottom". More on Inlined Images In general, text is not flowed around images. Instead, think of the text as a stream of items with an inlined image just occuring as one more item in the stream. The only exceptions to this are additions to the ALIGN attribute (align=left|right) which DO allow text to be flowed either to the left or the right of an image. This Tekke style rug was imported from Pakistan.
1986
The
tag can be used to start a new line beside the image. Then the
tag is extended to have an attribute CLEAR=left|right|all to start a new line where the left margin is clear of images, the right margin, or both. Inlined Images: Performance More attributes of the IMG tag specify the width and height of the image in pixels. Typically, images are quite large and take longer to download than text files. If the browser knows the width and height of the image, it can leave space for the image and go ahead and format the remaining text. The image can be downloaded afterward. This means that the viewer can go ahead and start reading text after the image while waiting for it to download. If the width and height specified do not match the actual image, the image is automatically scaled to fit. Interlaced gifs are another technique for downloading images in strips. External Viewers for Images, Audio, and Video Mosaic and Netscape can show images in other formats as well as audio and video. The image, audio, or video must be in a file with the correct file extension. For example, images in JPEG or TIFF formats must have the form image1.jpeg image2.tiff Or one audio format has the form sounds.au In your document, you put an anchor to an external document which has the image, audio, or video Click here to see a picture of a Tekke rug. Saying "click here" is not usually recommended. Instead people generally put a tiny version of the picture, called a thumbnail. Any such picture will have a blue bar around it and everyone assumes that it can be clicked on to get a larger version of the picture. Tekke Prayer Rug External Viewers, continued There is a fairly standard list of free viewers which are available to anyone with a Mosaic or Netscape client. However, this is an area where you should know what kind of viewers your intended audience is likely to have. Audio and video are available through anchors. Here is a message from one of our friendly salespersons. Or simply put an audio icon to indicate an audio file. Since people have a wide variation in how fast their network is, it is a nice style to warn people if an image, audio, or video is likely to be large enough to cause some people to have too slow a download time. The download time is roughly equivalent to the size of the file, so these objects often have sizes posted. My video 3 Mbytes - Very Slow! Producing Images Methods of producing images Using Graphics programs such as SuperPaint, Freehand, and PhotoShop Scanned Photos Photo CD produced from 35 mm negatives Digital camera - low quality such as QuickTake or high quality Image Conversion to produce GIF's on a Mac PhotoShop for scanned photos and graphics Debabelizer for anything GraphicsConverter (freeware) Image Conversion on a Unix workstation with X windows: xv Forms Forms provide a method for a Web viewer to send information back to the server of the HTML document. Attributes of this tag are discussed in CGI programming. Within one form many pieces of information can be collected and returned to the server. Text entry fields, one line Password fields Scrollable text fields Checkboxes (off/on toggle) Radio buttons Pop-up menus Push buttons - submit and reset Example begin form tag: Before the end of the form, we will ask for all the information from one customer. (There is no way to tell if two different forms came from the same session.) Clickable Maps Allow users to click on areas of a map or picture to get more information on the subject represented there. To define a map, get an image and find the pixel coordinates of the "hot spots" (link areas). xv is a handy program for this. Each hotspot has a shape of circle, polygon, or rectangle. The rectangle is given by Upper Left corner and Lower Right corner pixel coordinates, the circle by Center and an edge-point, and the polygon by a sequence of points. Example definition of an image map file (called usa.map) with two hot spots: default default.html rect /map/indiana.html 230,100 260,150 circle /map/rhodeisland.html 600,90 600,85 Put a link to an image map in your html document and use the ISMAP attribute in the tag that refers to the actual image. Formatting Tables An html table (withinand
) consists of a number of rows, each of which has a number of cells. Formatting with tables on a Web page provides a good way to place and align images and text. Attributes for the table tag CELLSPACING=value - the amount of space between individual cells CELLPADDING=value - the amount of space between the border of a cell and the contents of the cell BORDER to specify there should be a line around the table and inbetween the cells, or BORDER=value to give the width of the border. WIDTH=value|percent - allows you to describe the desired width in pixels or as a percentage of the document width. What's Inside a Table Within the table tags can be a caption tag and some number of row tags.. . . Other html tags can be used inside these tags to format the caption text. Thetag has an ALIGN=top|bottom attribute to say where to place the caption. . . . Within each pair of row tags will be all the cell tags of that row. Thetag can have ALIGN and VALIGN attributes as described below to specify allignment for all cells in that row. Within the row tags are any number of cell and header tag pairs. If the rows of a table don't have the same number of cells, they will be padded with blank cells to the length of the longest row. . . . Within these tags is the contents of an individual cell (table data). Other html tags can be used to to make text, images, links, etc.. . . Header cells are just like data cells, except that the text is bold face and centered. Attributes to align contents of cells ALIGN=left|center|right VALIGN=top|middle|bottom|baseline Examples of a TableFor examples of every type of table, see http://home.netscape.com/assist/net_sites/table_sample.html Frame Documents in Netscape 2.0 Browsers Multiple, independently scrollable frames in a single browser screen. Each frame can have its own URL. Frames can be used to place static objects within the window, such as banners, table of contents, control bars, copyright notices, etc. Frames also provide the ability to view more than one information source, such as submitting a keyword for searching in one frame and viewing its results in another. Both can be on the screen at one time. In an html frame document, the tags replace the tags of a normal html document. The frameset tag can have one of the attributes: ROWS="rowheightvaluelist" where each value is either in pixels or a percent. COLS="columnwidthlist", also is pixels or percents. Within the frameset tags, only the tags, ,
Tekke Rugs Bokhara Rugs . . . , and (for nested frames) can appear. The tag pair can give a normal html body for browsers that don't have frames. Formatting Frames Each frame can have attributes: SRC="URL" - the contents of the frame NAME="windowname" - This assigns a name to this frame. The contents of this frame (and others in the same screen) can use this name to display the results of links using the new target attribute to anchor tags: . . . SCROLLING="yes|no|auto" - tells whether this frame will have a scrollbar or not. NORESIZE - This flag restricts the user from resizing the browser window. MARGINWIDTH=value and MARGINHEIGHT=value Example of a Frame Document Web Techology class at Syracuse University