COMP 20: Web Programming

HyperText Markup Language (HTML)

In the Beginning, There Was SGML

HyperText Markup Language (HTML)

Structure of an HTML Page

<html>

<!-- This is a comment. It doesn't appear in the rendered document on the browser. -->
<!-- This part of the document contains HTML -->

<head>
<!-- Information about the page (e.g., title, abstract, stylesheet declarations, keywords) goes here... -->
<!-- ...Does not appear in the rendered document. -->
</head>

<body>
<!-- Content of the page goes here.  So many ways to create content. -->
</body>

</html>

Basic Elements

More on HTML Tags and Attributes

Links and Anchors

Images

Lists

Special HTML Entities (Characters)

metadata

Tables

Internet Media Types and the <link> Tag

Common Errors in HTML

The Extensible Markup Language (XML)

Wide Uses of XML

So What Does the Current Version of HTML, HTML5, Provide?

Deprecated Tags in HTML5

Deprecated Attributes in HTML5

HTML5: What is In

Structure of an HTML5 Document

<!DOCTYPE html>
<html>
        <head>
                <title>An HTML Document</title>
                ...
                ...
                ...
        </head>

        <body>
                ...
                ...
                ...
        </body>
</html>

Questions

  1. Why should you almost always use relative URLs for your website?
  2. Give an example where you should use an absolute URL.
  3. In HTML5, the border attribute is prohibited for images. Why?
  4. It is good practice to also set height and width attributes for image. Why?
  5. Compliance with the Section 508 Amendment to the Rehabilitation Act of 1973 requires the alt attribute to describe the image (alternative text). Why?