Now let's consider HTML theory

Web standards

What are standards?

The Internet is built on a set of rules that are developed and agreed by a cooperative effort and overseen by some internationally accepted standards organization.  These technical and behavioral rules define standards which allow applications built to be used on the internet to work with the components of the internet. In some cases standards are absolutely mandatory if the application is to work (think TCP/IP); in others standards are a good idea that can make applications more efficient, less costly, and forward compatible.

It is good to know what the standards are so that we can know when and why we might have to deviate from them.

[top]

advantages of standards

Current standards may not yet be mandatory, but knowing what they are and starting to use them will be helpful in the long run.

[top]

current standards

structural layer - defining what an object means on a page (as discussed by your text)

presentation layer - defining what an object looks like on a page

[top]

what does that mean for us?

It means we will attempt to keep structure and presentation separate. For today, we will concentrate on structure by concentrating on HTML.

[top]

HTML overview

What is a markup language?

[top]

HTML The Hyper Text Markup Language

is simply one of many markup languages, but there are some key differences:

[top]

HTML Elements and tags

Elements are marked by start and end tags.  For instance, these tags tell the content of the element how to display

Some elements can take attributes that define the properties of the element such as centering a Heading 4

They follow rules about nesting and placement. In general, both sides of the content must be balanced and consistent

<p> <h4 align="center" >the marked-up content</h4> </p>

tells the browser to

<(open) paragraph>
    <(open) heading 4 in the center of the line>
        the marked-up content
    <close heading 4>
<close paragraph>

in mirrored order

or, as it will display

the marked-up content


[top]

HyperText Document structure

  1. <html> the outermost element, indicates that the enclosed text is html and therefore must use an html-capable program to open it
  2. <head> the first element inside <html> >
  3. a container for information about the document; this is where one might place meta-information about the document as well as the <title>page title</title>
  4. remember, balanced and consistent; one must close the HEAD, </head>
  5. <body>> the BODY element contains all the text and other material that is to be displayed
    • and, of course, the document is balanced as it is closed, </body>
  6. and consistent, as HTML is closed as well - </html>

So the structure should look like

<html>
    <head>
        <title>page title</title>
    </head>

    <body>
        <p>a paragraph in the body of the page</p>
    </body>
</html>


Although we can get away without putting end tags on elements (because many browsers are lax about it), we will adopt the habit of always closing any tag we open so that we are compliant with current and future standards.

[top]

Getting started with HTML

We'll sort of follow this W3C intro, doing the things he recommends as we go. You may, if you wish, use his guidance to create your own good code for your own new pages

[top] [tags]