Web - Travaux Pratiques 1

Similar documents
CSS : petits compléments

Liste d'adresses URL

"Internationalization vs. Localization: The Translation of Videogame Advertising"

( François Agneray. Octobre 2012

Audit de sécurité avec Backtrack 5

HTML5 and CSS3. new semantic elements advanced form support CSS3 features other HTML5 features

CST 150 Web Design I CSS Review - In-Class Lab

Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Archived Content. Contenu archivé

Archived Content. Contenu archivé

CSS. CSS - cascading style sheets CSS - permite separar num documento HTML o conteúdo do estilo. ADI css 1/28

Thursday, February 7, DOM via PHP

Technical Service Bulletin

Office of the Auditor General / Bureau du vérificateur général FOLLOW-UP TO THE 2010 AUDIT OF COMPRESSED WORK WEEK AGREEMENTS 2012 SUIVI DE LA

N1 Grid Service Provisioning System 5.0 User s Guide for the Linux Plug-In

HEALTH CARE DIRECTIVES ACT

Archived Content. Contenu archivé

"Templating as a Strategy for Translating Official Documents from Spanish to English"

Archived Content. Contenu archivé

Personnalisez votre intérieur avec les revêtements imprimés ALYOS design

Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server

Archived Content. Contenu archivé

Web layout guidelines for daughter sites of Scotland s Environment

Measuring Policing Complexity: A Research Based Agenda

Installation troubleshooting guide

EPREUVE D EXPRESSION ORALE. SAVOIR et SAVOIR-FAIRE

"Simultaneous Consecutive Interpreting: A New Technique Put to the Test"

Simply download Beepip from and run the file when it arrives at your computer.

State of Maryland Health Insurance Exchange

Survey on Conference Services provided by the United Nations Office at Geneva

Sun StorEdge A5000 Installation Guide

Hours: The hours for the class are divided between practicum and in-class activities. The dates and hours are as follows:

Sun StorEdge RAID Manager Release Notes

ANNEX 1. Le Greffe. The Registry

Inspection des engins de transport

Scrubbing Disks Using the Solaris Operating Environment Format Program

Sun Enterprise Optional Power Sequencer Installation Guide

Licence Informatique Année Exceptions

Archived Content. Contenu archivé

Web Design Basics. Cindy Royal, Ph.D. Associate Professor Texas State University

Archived Content. Contenu archivé

Optimizing Solaris Resources Through Load Balancing

Level 2 French, 2014

Web Design with CSS and CSS3. Dr. Jan Stelovsky

STUDENT APPLICATION FORM (Dossier d Inscription) ACADEMIC YEAR (Année Scolaire )

Langages Orientés Objet Java

Calcul parallèle avec R

FACULTY OF MANAGEMENT MBA PROGRAM

BUSINESS PROCESS OPTIMIZATION. OPTIMIZATION DES PROCESSUS D ENTERPRISE Comment d aborder la qualité en améliorant le processus

BILL C-665 PROJET DE LOI C-665 C-665 C-665 HOUSE OF COMMONS OF CANADA CHAMBRE DES COMMUNES DU CANADA

Essential HTML & CSS for WordPress. Mark Raymond Luminys, Inc mraymond@luminys.com

Solaris 9 9/05 Installation Roadmap

Upgrading the Solaris PC NetLink Software

FOR TEACHERS ONLY The University of the State of New York

Sun Management Center Change Manager Release Notes

Générer des graphiques 3D - Cours Université de Sfax

Sun StorEdge Availability Suite Software Point-in-Time Copy Software Maximizing Backup Performance

HTML5 & CSS3. Jens Jäger Freiberuflicher Softwareentwickler JavaEE, Ruby on Rails, Webstuff Blog: Mail: mail@jensjaeger.

Internet Ohjelmointi 1 Examples 4

Introduction au BIM. ESEB Seyssinet-Pariset Economie de la construction contact@eseb.fr

Altiris Patch Management Solution for Windows 7.6 from Symantec Third-Party Legal Notices

Service Level Definitions and Interactions

Product / Produit Description Duration /Days Total / Total

Responsive Web Design: Media Types/Media Queries/Fluid Images

Automate de sécurité SmartGuard 600

Altiris Patch Management Solution for Windows 7.5 SP1 from Symantec Third-Party Legal Notices

Cliquez sur le résultat que vous avez obtenu au test de classement linguistique Click on the result you obtained following the language test

General Certificate of Education Advanced Level Examination June 2012

Sun Management Center 3.6 Version 5 Add-On Software Release Notes

Style & Layout in the web: CSS and Bootstrap

NUNAVUT HOUSING CORPORATION - BOARD MEMBER RECRUITMENT

Service Level Agreement in the Data Center

Coding Standards for Web Development

LAN-Free Backups Using the Sun StorEdge Instant Image 3.0 Software

Solaris 10 Documentation README

SunFDDI 6.0 on the Sun Enterprise Server

Web Design and Databases WD: Class 7: HTML and CSS Part 3

Group Projects M1 - Cubbyhole

Comparing JavaServer Pages Technology and Microsoft Active Server Pages

Introduction to Oracle Solaris 11.1 Virtualization Environments

C:\wamp\www\webdok\07bootstrap\bootstrap dist\css\bootstrap.css 2. juli :18

Join the Bilingual Revolution today! French-English Dual Language Programs. In New York City Public Schools

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

Office of the Auditor General / Bureau du vérificateur général FOLLOW-UP TO THE 2007 AUDIT OF THE DISPOSAL OF PAVEMENT LINE MARKER EQUIPMENT 2009

Tool & Asset Manager 2.0. User's guide 2015

Principles of Web Design 6 th Edition. Chapter 12 Responsive Web Design

TABLECLOTHS TEMPLATES

Exploring the iplanet Directory Server NIS Extensions

Évariste Galois and Solvable Permutation Groups

Oracle Advanced Support Gateway Installation Guide

Oracle Hardware Management Pack Security Guide

Millier Dickinson Blais

Transcription:

Web - Travaux Pratiques 1 Pour rappel, le squelette d une page HTML5 est la suivante : Syntaxe <html lang="fr"> <meta charset="utf-8"/> <title>... </title> <body>... Une fois qu une page est terminée, il est nécessaire de vérifier si elle est valide en utilisant le validateur W3C sur : http://validator.w3.org Par ailleurs, les sites qui peuvent vous être utiles sont : alsacreations at http://www.alsacreations.com (site français) W3School at http://www.w3schools.com 1 Exercice Pour commencer en douceur, analysez et testez le code suivant : Syntaxe <html lang="en"> <meta charset="utf-8"> <title>html5 Feature Detection</title> <script src="modernizr-latest.js"></script> 1

<body> <p>the verdict is... <span id="result"></span></p> <script> var result = document.getelementbyid("result"); if (Modernizr.draganddrop) result.innerhtml = "drag-and-drop supported."; else result.innerhtml = "drag-and-drop not supported."; </script> 2 Exercice On souhaite écrire le code pour le formulaire suivant : Au niveau HTML, on utilisera des <fieldset> avec <legend>, des <label> et des <input> HTML5 chaque fois que possible. Au niveau CSS, on utilisera la valeur inline-block pour la propriété display des <label>, et les <input> et <textarea> qui sont required et invalid auront une couleur de fond jaune pale. 2

Au niveau JavaScript, on contrôlera (avec modernizr) la validité des données lors d un onsubmit pour les navigateurs qui ne reconnaissent pas la propriété required. On contrôlera également qu au moins 20 caractères ont été tapées dans le <textarea> en utilisant la fonction JavaScript setcustomvalidity. Solution: zoo.html <html lang="en"> <meta charset="utf-8"> <title>zookeeper Form</title> <link href="zoo.css" rel="stylesheet"> <script src="modernizr-latest.js"></script> <body> <h1>zoo Keeper Application Form</h1> <form id="zookeeperform" action="#" > <p><i>please complete the form. Mandatory fields are marked with </i><em>*</em></p> <fieldset> <legend>contact Details</legend> <label for="name">name <em>*</em></label> <input id="name" placeholder="jane Smith" autofocus required><br> <label for="telephone">telephone</label> <input id="telephone" placeholder="(xxx) xxx-xxxx"><br> <label for="email">email <em>*</em></label> <input id="email" type="email" required><br> </fieldset> <fieldset> <legend>personal Information</legend> <label for="birthdate">birth Date<em>*</em></label> <input id="birthdate" type="date" required><br> <label for="age">age<em>*</em></label> <input id="age" type="number" min="0" max="120" step="1" required><br> <label for="gender">gender</label> <select id="gender"> <option value="female">female</option> <option value="male">male</option> </select><br> <label for="comments">when did you first know you wanted to be a zoo-keeper?<em>*</em>< /label> <textarea id="comments" required></textarea> </fieldset> <fieldset> <legend>pick Your Favorite Animals</legend> <label for="zebra"><input id="zebra" type="checkbox"> Zebra</label> <label for="cat"><input id="cat" type="checkbox"> Cat</label> <label for="anaconda"><input id="anaconda" type="checkbox"> Anaconda</label> <label for="human"><input id="human" type="checkbox"> Human</label> <label for="elephant"><input id="elephant" type="checkbox"> Elephant</label> <label for="mouse"><input id="mouse" type="checkbox"> Mouse</label> <label for="pigeon"><input id="pigeon" type="checkbox"> Pigeon</label> <label for="crab"><input id="crab" type="checkbox"> Crab</label> </fieldset> <p><input type="submit" value="submit Application"></p> </form> <script src="zoo.js"></script> Solution: zoo.js var form = document.getelementbyid("zookeeperform"); form.onsubmit=validateform; var area = document.getelementbyid("comments"); area.oninput=validatecomments; function validatecomments() { 3

if (area.value.length < 20) area.setcustomvalidity("commentaire trop court."); else area.setcustomvalidity(""); function validateform() { if (!Modernizr.input.required) { var inputelements = form.elements; for(var i = 0; i < inputelements.length; i++) { if (inputelements[i].hasattribute("required")) { if (inputelements[i].value == "") { alert("custom required-field validation failed. The form won t be submitted."); return false; return true; Solution: zoo.css body { max-width: 530px; margin: 0 auto; fieldset { margin-bottom: 1.5rem; padding: 1,5rem; legend { font-weight: bold; font-variant: small-caps; label { width:30%; min-width: 100px; max-width: 200px; display: inline-block; vertical-align: top; em { font-weight: bold; font-style: normal; color: red; input:focus { background: #eaeaea; input, textarea, select { width: 65%; max-width: 300px; margin: 0.5rem; textarea { height: 100px; input[type=checkbox] { width: 1rem; 4

input[type=submit] { width: 15rem; padding: 1rem; textarea:required:invalid, input:required:invalid { background-color: lightyellow; 3 Exercice 1. Ecrire le code pour la page suivante : 2. Intégrer des informations Microdata pour les types suivants : http ://schema.org/person http ://schema.org/organization http ://schema.org/postaladdress 3. Vérifier sur http://www.google.com/webmasters/tools/richsnippets Solution: microdata.html <html lang="en"> <meta charset="utf-8"> <title>a propos de Tux</title> <style> body { margin-left: 25px; margin-right: 25px; </style> <body> <h1>about Me</h1> <div itemscope itemtype="http://schema.org/person"> <img itemprop="image" src="figures/penguin.jpeg" alt="photo de Tux"> <p> Ce website est le travail de <b itemprop="name">tux the Penguin</b>. Ses amis le nomment aussi <b itemprop="additionalname">tuxy</b>. <span itemprop="jobtitle" style="display:none">mascotte Linux</span> </p> 5

<div itemprop="affiliation" itemscope itemtype="http://schema.org/organization"> Vous pouvez le contacter à <span itemprop="name">la compagnie Linuxienne</span> <ul> <li> tel : <span itemprop="telephone">0320111111</span> (et demander après Tux) </li> <li> email : <span itemprop="email">tux at linux.com</span> </li> </ul> </div> <p>ou alors, visitez Tux sur son lieu de travail : </p> <address itemprop="address" itemscope itemtype="http://schema.org/postaladdress"> <span itemprop="streetaddress">3, rue de Paris</span><br> <span itemprop="addresslocality">lille</span>, <span itemprop="postalcode">59000</span><br> <span itemprop="addresscountry">france</span><br> </address> <a itemprop="url" href="http://www.tuxeries.com">www.tuxeries.com</a> </div> 6