Historique

HTML 4.0

SGML - Standard Generalized Markup Language

Marquage de documents permettant d'enrichir le contenu:

HTML est un exemple de marquage

Un exemple de document HTML

<!DOCTYPE HTML PUBLIC
 "-//W3C//DTD HTML 4.0//EN"
 "http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
 <HEAD>
  <TITLE>My first HTML document</TITLE>
 </HEAD>
 <BODY>
   <IMG src="logo.gif">
   <P>Hello world!
 </BODY>
</HTML>

Définition d'un langage de marquage

Eléments et Attributs

Eléments

Attributs

Notes:

  • "Tags" et Eléments ne sont pas synonymes!!!
  • La structure d'un document est un arbre

  • -> <I>foo<B>bar</I></B> est invalide

    Document Type Definition (DTD)

    <!ELEMENT UL - - (LI)+>
    <!ELEMENT IMG - O EMPTY>
    
    <!ATTLIST MAP
     name    CDATA  #REQUIRED
    >
    
     id      ID     #IMPLIED  -- document-wide unique id -- 
     rowspan NUMBER 1         -- number of rows spanned by cell --

    Caractères

    Commentaires

      <!-- ceci est un commentaire -->
      <!-- Attention -- ceci n'est pas valide! -->
      <P -- ceci non plus! -->

    Structure Globale

    Information sur la version d'HTML utilisée (DOCTYPE)

    <!DOCTYPE HTML PUBLIC
     "-//W3C//DTD HTML 4.0//EN"
     "http://www.w3.org/TR/REC-html40/strict.dtd">
    
    <!DOCTYPE HTML PUBLIC
     "-//W3C//DTD HTML 4.0 Transitional//EN"
     "http://www.w3.org/TR/REC-html40/loose.dtd">
    
    <!DOCTYPE HTML PUBLIC
     "-//W3C//DTD HTML 4.0 Frameset//EN"
     "http://www.w3.org/TR/REC-html40/frameset.dtd">

    Une section de déclaration (HEAD, TITLE, META, ...)

    Le corps du document (BODY or FRAMESET)

    Deux catégories d'éléments: "block-level" et "inline" (ou "text-level")

    Texte

    Listes

    Tableaux

    Note:
    A ne pas utiliser simplement pour controller le formattage d'un document!!! (cf. CSS Positioning)

    Tableaux - Exemple

    <TABLE border="1"
     summary="This table gives some statistics about fruit
              flies: average height and weight, and percentage
              with red eyes (for both males and females).">
     <CAPTION><EM>A test table with merged cells</EM></CAPTION>
     <TR><TH rowspan="2"><TH colspan="2">Average
      <TH rowspan="2">Red<BR>eyes
     <TR><TH>height<TH>weight
     <TR><TH>Males<TD>1.9<TD>0.003<TD>40%
     <TR><TH>Females<TD>1.7<TD>0.002<TD>43%
    </TABLE>
    
            A test table with merged cells
    /-----------------------------------------\
    |          |      Average      |   Red    |
    |          |-------------------|  eyes    |
    |          |  height |  weight |          |
    |-----------------------------------------|
    |  Males   | 1.9     | 0.003   |   40%    |
    |-----------------------------------------|
    | Females  | 1.7     | 0.002   |   43%    |
    \-----------------------------------------/

    Liens

    Images, Applets et Objets

    DIV et SPAN

    Style

    Frames

    Note:
    A éviter! Trop orienté vers les agents graphiques, pas de "bookmark" possible, pas de mécanisme de synchronisation.

    Frames - Exemple

    <!DOCTYPE HTML PUBLIC
     "-//W3C//DTD HTML 4.0 Frameset//EN"
     "http://www.w3.org/TR/REC-html40/frameset.dtd">
    <HTML>
    <HEAD>
     <TITLE>A simple frameset document</TITLE>
    </HEAD>
    <FRAMESET cols="20%, 80%">
     <FRAMESET rows="100, 200">
      <FRAME name="frame1" src="contents_of_frame1.html">
      <FRAME src="contents_of_frame2.gif">
     </FRAMESET>
     <FRAME src="contents_of_frame3.html">
     <NOFRAMES>
      <P>This frameset document contains:
      <UL>
       <LI><A href="contents_of_frame1.html">Some neat contents</A>
       <LI><IMG src="contents_of_frame2.gif" alt="A neat image">
       <LI><A href="contents_of_frame3.html">Some other neat contents</A>
      </UL>
     </NOFRAMES>
    </FRAMESET>
    </HTML>
    
     ---------------------------------------
    |         |                             |
    |         |                             |
    | Frame 1 |                             |
    |         |                             |
    |         |                             |
    |---------|                             |
    |         |          Frame 3            |
    |         |                             |
    |         |                             |
    |         |                             |
    | Frame 2 |                             |
    |         |                             |
    |         |                             |
    |         |                             |
    |         |                             |
     ---------------------------------------

    Formulaires

    Script

    Validation

    "Dynamic HTML"

    Terme marketing

    Comprend:

    Evolution future