Création d'Applications sur Internet





Chapitre3b: Langage HTML

Fatemeh BORRAN

Sommaire

Balises embarquées

Audio

Vidéo

Embed/Object

Frames

Frames: exemple

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">   
      <title>Frames</title>      
   </head>
   <body>
      <iframe src="http://www.heig-vd.ch/" width="100%" height="350px">
      </iframe>
      <br/>
      <iframe src="http://www.w3schools.com/html/default.asp" 
      	width="100%" height="350px">
      </iframe>
   </body>      
</html>
TryItNow
FramesOutput

Sommaire

Formulaires

Exemples de formulaires

Formulaire

Utilisation des formulaires

FormulaireUsage

Balise de formulaire

Attributs de la balise <form>

Dans la zone d'activité de <form>

Eléments de formulaires (1/5)

Eléments de formulaires (2/5)

Listes déroulantes

<select name="jour" size="1">
  <option value="lundi">lundi</option>
  <option value="mardi">mardi</option>
  <option value="mercredi">mercredi</option>
  <option value="jeudi">jeudi</option>
  <option value="vendredi">vendredi</option>
</select>
TryItNow

<select name="jour" size="5">
  <option value="lundi">lundi</option>
  <option value="mardi">mardi</option>
  <option value="mercredi">mercredi</option>
  <option value="jeudi">jeudi</option>
  <option value="vendredi">vendredi</option>                                      
</select>
TryItNow

Eléments de formulaires (3/5)

Boutons radio (pour un choix unique parmi plusieurs possibles).

Eléments de formulaires (4/5)

Cases à cocher (pour plusieurs choix possibles parmi plusieurs).

Eléments de formulaires (5/5)

Aperçu global des balises de formulaires

Formulaires

Exemple de formulaire (1/3)

Ci-dessous, un exemple de formulaire. Les différents éléments ont été placés dans une table, afin de les aligner proprement (cf. code des 2 slides suivants).


FormulaireOutput

Exemple de formulaire (2/3)

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">   
    <title>Fromulaire</title>
  </head>
  <body>
    <form method="post" action="script.php">
      <fieldset>
        <legend>Enregistrement d'un utilisateur</legend>
        <table>
          <tr>
            <td>Nom</td>
            <td><input type="text" name="nom"/></td>
          </tr>
          <tr>
            <td>Prénom</td>
            <td><input type="text" name="prenom"/></td>
          </tr>
          <tr>
            <td>Sexe</td>
            <td>Homme : <input type="radio" name="sexe" value="M"/><br/>
            Femme : <input type="radio" name="sexe" value="F"/></td>
          </tr>
          ...

Exemple de formulaire (3/3)

...
          <tr>
            <td>Fonction</td>
            <td>
              <select name="fonction">
                <option value="enseignant">Enseignant</option>
                <option value="etudiant">Etudiant</option>
                <option value="ingenieur">Ingénieur</option>
                <option value="retraite">Retraité</option>
                <option value="autre">Autre</option>
              </select>
            </td>
          </tr>
          <tr>
            <td>Commentaires</td>
            <td>
              <textarea rows="3" name="commentaires">
                Tapez ici vos commentaires</textarea>
            </td>
            </tr>
            <tr>
              <td colspan="2"><input type="submit" value="Envoyer"/></td>
            </tr>
          </table>
        </fieldset>
      </form>
   </body>
</html>
TryItNow

Sommaire

La mise en page

Comment structurer sa page?

HTML5

Mise en Page: Structure

Mise en Page: Structure <header>

Header

Mise en Page: Structure <footer>

Footer

Mise en Page: Structure <nav>

Nav

Mise en Page: Structure <section>

Section

Mise en Page: Structure <aside>

Aside

Mise en Page: Structure <article>

Article

Structure HTML5 : exemple (1/2)

StructureOutput

Structure HTML5 : exemple (2/2)

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"> 
    <title>Structure HTML5</title>      
  </head>
  <body>
    <header id="header">
      <img src="header.jpg" width="20%" height="20%"/>
    </header>
    <nav id="nav">
      <a href="http://www.w3schools.com/html/default.asp" target="content">HTML</a> |
      <a href="http://www.w3schools.com/css/" target="content">CSS</a> |
      <a href="http://www.w3schools.com/php/" target="content">PHP</a> |
      <a href="http://www.w3schools.com/js/" target="content">Java Script</a>
    </nav>
    <section id="section">      
      <iframe name="content" width="100%" height="400px"></iframe>
    </section>
    <aside id="aside">
      Les logiciels nécessaires:
      <ul>
        <li>NotePad++</li>
        <li>Firefox</li>
        <li>EasyPHP</li>
      </ul>
    </aside>
    <footer id="footer">
      Cours AP-CAI @ 2014-2015
    </footer>
  </body>
</html>
TryItNow

Questions?!

Questions?!

Année 2015-2016 - Fatemeh Borran - /