Docsity

Notes sur la programmation client web: CSS et javascript, Notes de Applications des sciences informatiques

Aperçu partiel du texte

Télécharge Notes sur la programmation client web: CSS et javascript et plus Notes au format PDF de Applications des sciences informatiques sur Docsity uniquement!

Programmation client webProgrammation client web

cours 6 : CSS et javascript cours 6 : CSS et javascript

Plan

F (^) Modèles de programmation via le service Web F (^) Protocole HTTP F (^) HTML l (^) BALISES F (^) Cascading Style Sheet F (^) Javascript F (^) Applet java

Les propriétés CSS

F (^) Color & Background F (^) Font F (^) Text F (^) Box Model : margin, padding, border, width, height F (^) Visual Effect : overflow, visibility F (^) Generated Content & list F (^) Table F (^) UI F (^) Page, Aural

Organisation visuel

Margin

F (^) margin l (^) 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' l (^) une longueur ; un pourcentage (de la largeur de la boîte) ; auto (calcul) ; inherit l (^) 1, 2, 3 ou 4 valeurs (répétées par côtés opposés) F (^) Exemple : BODY { margin: 2em } /* all margins set to 2em / BODY { margin: 1em 2em } / top & bottom = 1em, right & left = 2em / BODY { margin: 1em 2em 3em } / top=1em, right=2em, bottom=3em, left=2em / F (^) La dernière ligne est équivalente à : BODY { margin-top: 1em; margin-right: 2em; margin-bottom: 3em; margin-left: 2em; / copied from opposite side (right) */ }

Padding

F (^) padding l (^) 'padding-top', 'padding-right', 'padding-bottom', 'padding-left' l (^) longueur ; pourcentage (de la largeur de la boîte); inherit l (^) 1, 2, 3 ou 4 valeurs (répétées par côtés opposés) F (^) exemple-cours6/marginpadding.html

position

F (^) position l (^) static (normale) | relative (position calculée par rapport à la position normale) | absolute (position absolue dans le document, n’influence plus la mise en page) | fixed (fixe par rapport à la fenêtre – scroll) | inherit l (^) Position précisée (si non static) avec top, right, bottom et left F (^) top, right, bottom et left l (^) | (largeur ou hauteur de la boîte) | auto (calcul automatique, dépend des cas) | inherit l (^) Besoin de 2, sinon étirement F (^) exemple-cours6/position.html

float

F (^) float l (^) Texte flotant l (^) Value: left | right | none | inherit l (^) Initial: none F (^) clear l (^) Pour indiquer quel côté ne peut pas être adjacent avec des éléments flottants précédents l (^) left ; right ; both ; none F (^) exemple-cours6/float.html F (^) z-index : pour préciser la position : ceux de plus haut niveau apparaissent au dessus, pour les éléments positionnés (top…) l (^) Sinon, ordre inverse d’apparition F (^) exemple-cours6/z.html

height

F (^) ' height ' l (^) | | auto | inherit l (^) Initial: auto l (^) Applies to: all elements but non-replaced inline elements, table rows, and row groups l (^) Inherited: no l (^) Percentages: refer to width of containing block l (^) Media: visual F ' height -width‘, ‘height -width’ l (^) Value: | | inherit ( | none pour max-width) l (^) Initial: User Agent dependent l (^) Applies to: all elements except non-replaced inline elements and table elements l (^) Inherited: no l (^) Percentages: refer to width of containing block l (^) Media: visual F (^) exemple-cours6/height.html

Hauteur de ligne

F (^) 'line-height' l (^) Value: normal | | | | inherit u (^) Nombre : coefficient multiplicatif (par rapport à la plus grande font) l (^) Initial: normal ; Applies to: all elements ; Inherited: yes ; Percentages: refer to the font size of the element itself ; Media: visual F (^) 'vertical-align' l (^) Value: baseline | sub | super | top | text-top | middle | bottom | text-bottom | < percentage> | | inherit u (^) Pourcentage ou longueur : augmente (> 0) ou diminue ( < 0) la position verticale l (^) Initial: baseline ; Applies to: inline-level and 'table-cell' elements ; Inherited: no ; Percentages: refer to the 'line-height' of the element itself ; Media: visual F (^) exemple-cours6/h.html

Génération automatique

F (^) Pseudo-éléments :before :after l (^) Impact de compact et run-in F Content l (^) Value: [ | | | attr(X) | open-quote | close-quote | no-open-quote | no-close- quote ]+ | inherit l (^) Initial: empty string ; Applies to: :before and :after pseudo-elements ; inherited: no; Percentages: N/A; Media: all l (^) : texte entre " " l (^) : ressource externe l (^) : compteur, deux formes : 'counter(name)' or 'counter(name, style)'. l (^) open-quote et close-quote : par exemple caractères “ ” l (^) no-open-quote et no-close-quote : un rien qui remplace une “ ou une ” l (^) attr(X) : This function returns as a string the value of attribute X for the subject of the selector. The string is not parsed by the CSS processor. If the subject of the selector doesn't have an attribute X, an empty string is returned. The case-sensitivity of attribute names depends on the document language. Note. In CSS2, it is not possible to refer to attribute values for other elements of the selector. F (^) 'quotes' : Value: [ ]+ | none | inherit l (^) Définit une paire de guillemets

compteurs

F (^) 'counter-reset' l (^) Value: [ ? ]+ | none | inherit l (^) Initial: none ; Applies to: all elements ; Inherited: no ; Percentages: N/A ; ; Media: all l (^) Valeur de reset par défaut : 0 ; valeur négative possible F (^) 'counter-increment' l (^) Value: [ ? ]+ | none | inherit l (^) Initial: none ; Applies to: all elements ; Inherited: no ; Percentages: N/A ; Media: all l (^) Valeur d’incrément par défaut : 1 ; valeur négative possible

table

F (^) 'caption-side' l (^) Value: top | bottom | left | right | inherit l (^) Initial: top ; Applies to: 'table-caption' elements F (^) 'table-layout' l (^) Value: auto | fixed | inherit u (^) Auto : calcul automatique u (^) Fixed : fait référence aux éléments tels que width : rendu par colonne (selon s’il y a un ou plusieurs éléments fixés, sinon auto) l (^) Initial: auto ; Applies to: 'table' elements ; Inherited: no ; Percentages: N/A ; Media: visual F (^) Alignement vertical : 'vertical-align‘ F (^) Alignement horizontal : ‘text-algin’

table

F 'border-collapse' l (^) Value: collapse | separate | inherit l (^) Initial: collapse ; Applies to: 'table' elements ; Inherited: yes ; P ercentages: N/A ; Media: visual F (^) ‘border-spacing' (espace entre les bords des cellules) l (^) Value: ? | inherit u (^) Horizontal (puis vertical) l (^) Initial: 0 ; Applies to: 'table' elements ; Inherited: yes ; Percentages: N/A ; Media: visual F (^) 'empty-cells' l (^) Value: show | hide | inherit F (^) 'speak-header' (média aural) l (^) Value: once | always | inherit F (^) exemple-cours6/table.html