introsubmainglosscontact
arrow left arrow right

    Basic Text

    Already discussed is the way that tag-pairs are used to create containers in which content is held and certain rules applied to it; in short, the structural nature of HTML. We've already seen some of that in the way a Web document is split into two main sections: the document's header and body. In this chapter, we're going to get into some of the structures within the BODY.

    Again throughout this lesson, students are required to practise the new tags in their own documents. By practising each new pair of tags that are introduced, the student works from a basic foundation and builds upon this step by step to extend their knowledge of HTML. By the end of this lesson, students are required to have a simple html document that contains headings, paragraphs line breaks and blockquotes. You will be required to send the resulting html source code in the training report sheet below.

    Headings

    The heading structures are most commonly used to set apart document or section titles. For example, the word "Headings" at the beginning of this section is a heading. So is this document's title.

    • Remember that these heading structures go into the body of the document. The headings being discussed here have nothing to do with the HEAD structure from the previous chapter.

    There are six levels of headings, from Heading 1 through Heading 6. Heading 1 (H1) is "most important" and Heading 6 (H6) is "least important." 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. Here are all six HTML pairs, in descending order of importance.

    These six lines, when placed into an HTML document, will simply display the six levels of headings:

    <H1>Heading 1</H1>

    <H2>Heading 2</H2>

    <H3>Heading 3</H3>

    <H4>Heading 4</H4>

    <H5>Heading 5</H5>

    <H6>Heading 6</H6>

    Heading 1

    Heading 2

    Heading 3

    Heading 4

    Heading 5
    Heading 6
    Exercise:

    • Using a simple editor, (eg Microssoft Notepad (PC), Simple Text (Mac)), open a new file.

    • Create a simple document using the four tags learnt in the previous session (refer to Session 2 for details)

    • Using your name, surround the text with start and stop headline tags:

      eg

      Rae Story

    • Save this as a name.htm document and open it in your Netscape Naviagator (web browser). In Netscape under FILE scroll, choose "open file in browser"

    • Now try all of the above settings for Headings H1 through to H6 and view the results in Netscape.

      Heading tags automatically stand alone and thus you can never get two headings on one continuous line. This also means that you cannot highlight text in the middle of a paragraph by marking it as a heading. If you try this, the paragraph will be split in two, with the heading text on its own line between the two pieces. (Later on, we'll talk about ways of highlighting text.)

    Paragraphs

    As you might suspect, paragraphs are quite common in Web pages. They are one of the most basic structures in HTML.

    The beginning of a paragraph is marked by <P>, the beggining-of-paragraph tag is always a logical end-of-paragraph tag, thus there is no need to close the tag.

    • Any HTML tag which creates a line break, such as a headline, makes the text immediately following the line break a new paragraph, so the <P> tag is not needed.

    Exercise:

    • Using the Four tags learnt in Session two, and the new paragraph tag create a simple HTML fragment that shows the use of a paragraph.

      for eg,
      <HTML>
      <HEAD>
      <TITLE>Paragraphing</TITLE>
      </HEAD>
      <BODY>
      Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,Here is some text,

      HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph HERE Here is a new paragraph
      </BODY>
      </HTML>

    • Now view this in your Web browser as outlined in the above exercises.,

    Line Break

    So what if you want to end a line after a certain word, but don't want to start a new paragraph? Well, what you need is a line break, which is invoked by using the <BR> tag. This forces a line break wherever you place it in the content (that is, whatever is after the <BR> tag will start from the left margin of the next line on the screen.)

    And no, there is no </BR> tag. The line break tag is an empty tag. And when you think about it, this makes sense. The concept of a line break beginning and ending doesn't really work, since a line break is a one-shot occurrence.

    Try it yourself. This time lets encorporate line breaks and paragraphs to produce the correct format for displaying your name and adress.

    Exercise:

    • Using the four tags learnt in Session 2, HTML, HEAD, TITLE and BODY create a small fragment HTML document, the title is "Address"

    • In the main section:

      Please contact

      Your name
      Your address
      e.g. Walsall, West Midlands
      Continuation of document text....

    • Save this

    • Now view this in your web browser

    Blockquote

    Blockquotes are handy for those long pieces of text which are quoted material and therefore need to be set apart and indented. That is exactly what blockquote does. For example:

    This section of text is surrounded by the blockquote tags. A blockquote can exist inside of a paragraph, and always lives on its own line (which is to say, there is an implied line break before and after the blockquote, just as with headings or paragraphs themselves).

    Blockquotes are set up as follows:

    <blockquote> ...text... </blockquote> Just like most other things in HTML, it's a container.

    Please try if you like, but it is not required that you do, applications for blockquotes are limited.

    Lists

    There are three main types of lists. I've included the heading here because lists are basic text structures -- they just need a lot more explanation. That's what you'll find in the next section.


    training report sheet

    Use the information already covered to answer the following questions:-

    Email address

    Name


    1 Of the heading levels, Heading 1 is the:

    most important
    least important

    2 Headings should not be used to highlight text within a paragraph.

    True
    False

    3 Paragraphs are defined with:

    <P> ... <P>
    <P> ... </P>
    </P> ... <P>
    <P> ... <endP>
    <start> ... <finish>

    4 An end-of-line break is forced by using which tag?

    <HR>
    <BR>

    5 Place the source HTML code from this session into this box.

arrow left arrow right
introsubmainglosscontact