Make your own Web pages -2 Exercise 3 Type the following into notepad and save as index.htm. <HTML> <HEAD> <TITLE>Make Your own Web pages-for free </TITLE> </HEAD> <BODY> <h1>Welcome to the Home page of -Make Your own Web pages-for free .</h1> <h2>My second Headline </h2> </BODY> </HTML> The above is the basic HTML skeleton structure. HTML documents actually consist of two parts the Header and the body. The Header part contains information that is not displayed by the browser such as script, Meta Tags and Cascading Style sheets. The body part contains the actual document contents. HTML consists of a series of tags which are enclosed in Triangular brackets (< >).These tags are in pairs and are case-insensitive; that is, it doesn't matter whether you type them in upper or lower case. Using upper case makes the tags easier to pick out in a document, but you can do whatever you like. The tags are used by the browser for formatting the page but they are not displayed. Tags typically occur in begin-end pairs. These pairs are in the form <tag> .... .. </tag> Where the <tag> indicates the beginning of a tag-pair, and the </tag> indicates the end. (The dots indicate an arbitrary amount of content between the tags. The opening tags can also contain attributes which modify the tag e.g. <body bgcolor="white"> The first and last tags in a document should always be the HTML tags. These are the tags that tell a Web browser where the HTML in your document begins and ends. The absolute most basic of all possible Web pages is: <HTML> </HTML> That's it. If you were to load such a page into a Web browser, it wouldn't do anything except give you a blank screen, but it is a valid Web page. Next come the header tags <HEAD> and </HEAD>. The header tags contain all of the document's header information like the document title and so on. They are not displayed by the browser. Between the title tags <TITLE> and </TITLE> you should have the title of your document in this case --Make Your own Web pages-for free. This will appear at the top of the browser's title bar, and also appears in the history list of the browser and any bookmarks. If you don't type anything between the title tags or don't include the title tags at all then the browser will typically use the actual file name for the title which can be confusing. Finally the body tags <BODY> and </BODY>, between which Spaces You can place as many spaces as you want between words as HTML ignores additional spaces. Therefore if your type in: the extra spaces are removed it appears in a browser as the extra spaces are removed If you want extra spaces you need to use the code to denote a non breaking space. Therefore to create 3 extra spaces you enter it three times as here: Three extra spaces Headings The heading structures are most commonly used to divide sections of text. There are six levels of heading (from H1 to H6) and by default browsers will display the six heading levels in the same font, with the point size decreasing as the importance of the heading decreases. The HTML for Heading tags look like this: <H1>Text for Heading 1</H1> They are displayed by the browser as: Paragraphs A page is composed of a number of sections separated by headings, each of which is composed of one or more paragraphs. Each paragraph is composed of words, and each word of letters. The beginning of a paragraph is marked by <P>, and the end by </P>. When a browser comes across a <p> tag it starts a new line and adds some vertical white space between the last line and the new line. Links Links allow the reader to jump from one section of a document to another section of the document or to a new document altogether. This is shown in Figure 5 below: In order to link you require two things: The start of the link is called the hotspot and it shows up in the browser as underlined and in normally in blue until it has been clicked. It is designated in HTML by use of the anchor tag <A>. Unlike simple tags the anchor tag has extra attributes which specify the name of the tag (so that it can be linked to) and the destination web page or page section. The form is as shown in Figure 6:
you find everything that gets displayed in the browser window. So if you open index.htm using internet explorer. Internet explorer should display index.htm as shown in Figure 4:
Figure 4. index.htm as displayed by Internet Explorer
Figure 5 linking in an HTML
Wednesday, January 30, 2008
Make your own Web pages -2
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment