Skip to main content

Markup Languages: 3.1. HTML

Markup Languages
3.1. HTML
    • Notifications
    • Privacy
  • Project HomeTools and Techniques in Software Engineering
  • Projects
  • Learn more about Manifold

Notes

Show the following:

  • Annotations
  • Resources
Search within:

Adjust appearance:

  • font
    Font style
  • color scheme
  • Margins
table of contents
  1. Markup Languages
  2. 1. Grammar of HTML
  3. 2. Organizing HTML
  4. 3. Dialects
    1. 3.1. HTML
    2. 3.2. XML
    3. 3.3. XHTML
  5. 4. Attributes
  6. 5. Semantic HTML
  7. 6. Developing with HTML
  8. 7. Evolution
  9. 8. Bibliography

HTML

  • Basic structure similar to XML:
    • <> tags
    • Attributes
    • Entities for special characters.
    • Extra whitespace is generally ignored
  • Special-purpose: predefined set of tags.

Sample HTML

<html>
  <head>
    <title>Hello World</title>
  </head>
  <body>
    <p>
    Hello world!
  </body>
</html>

Two important attributes supported by all element types:

  • class: used to group related elements (typically for controlling display attributes with CSS).
  • id: provides a unique identifier for element. Very important when implementing dynamic effects (used to locate a particular element.
  • Irregular:

    • Some tags are singletons, such as <br>, <p>.
    • Not all attributes have to have values: <select name="equipment" multiple>
    • Some elements can overlap: <p><b>xyz</p><p>second</b> third</p>
  • Early browsers tried to "do the right thing" even in the face of incorrect HTML:

    • Ignore unknown tags
    • Carry on even with obvious syntax errors such as missing <body> or </html>
    • Infer the position of missing close tags
    • Guess that some < characters are literal, as in "What if x < 0?"
    • Example, a document with: Hello, world

& Not obvious how to interpret some documents (and browsers differed). * Users came to depend on browser quirks: * HTML documents with bad syntax still display. * Web page designers don't notice the problems, so bogus pages proliferate. * Browsers can't change to reject bad pages: would "break" too much content. * Newer browsers must emulate quirks of the very first Web browsers.

  • Being forgiving allows bad habits to develop, which you then have to tolerate forever.

Annotate

Next Chapter
3.2. XML
PreviousNext
Web Technology
Powered by Manifold Scholarship. Learn more at
Opens in new tab or windowmanifoldapp.org