Initiation html css

49
INITIATION HTML / CSS Created by Thamer Belfkih

Transcript of Initiation html css

Page 1: Initiation html css

INITIATION HTML / CSSCreated by Thamer Belfkih

Page 2: Initiation html css
Page 3: Initiation html css

HyperText Mark-Up Language

Page 4: Initiation html css
Page 5: Initiation html css
Page 6: Initiation html css

Cascading Style Sheets

Page 7: Initiation html css
Page 8: Initiation html css
Page 9: Initiation html css
Page 10: Initiation html css

CRÉATION DU PROJET

Page 11: Initiation html css

DOCTYPEle seule type de document à utiliser.

<!doctype html>

Page 12: Initiation html css

STRUCTURETECHNIQUE

Le HTML a une structure arborescente qui commence par <html>

Page 13: Initiation html css

Elle est composée de 2 grandes parties :

Page 14: Initiation html css

TITRE ET DESCRIPTIONles informations complémentaires (meta).

invisible pour l utilisateur.sont destinées aux moteurs de recherche.

<title>Titre de la page </title><<meta name="description" content="description de la page ">

Page 15: Initiation html css

ICÔNEle titre de la page s affiche également dans l onglet du

navigateur avec une icône (favion) .<<link rel="icon" href="favion.png">

Page 16: Initiation html css

FEUILLES DE STYLES CSSPour inclure une feuille de styles (stylesheet) :

<link rel="stylesheet" href="style.css">

Page 17: Initiation html css

MAUVAISES PRATIQUES :<style> </style><p style="color:red;"></p>

pcolor:red;

Page 18: Initiation html css

CONTENU HTML & SÉMANTIQUE

titres et paragraphes

h1 à h6 : titres et sous titres ( Headings)

p: contenu classique ( Paragraph)

br: revenir à la ligne (break) dans une paragraphe

Page 19: Initiation html css

listes et menus

ul : liste à puces ( unordered list)

ol : liste numérotée (ordered list)

li : élément dans une liste (list item)

Page 20: Initiation html css

##Example :

<ul> <li>R1</li> <li>R2 <ul> <li>R2.1</li> <li>R2.2</li> <li>R2.3</li> </ul> </li> <li>R3</li></ul>

Page 21: Initiation html css

CONTENUS MULTIMÉDIA ET INTERACTIF

Page 22: Initiation html css

LIENS HYPERTEXTES :IL EXISTE PLUSIEURS TYPES DELIENS

lien vers une autre page de site<a href="page.html">

lien vers un site externe (nouvel onglet) :<a href="http://example.com/" target="_blank">

lien vers un fichier<a href="fichier.pdf">

Page 23: Initiation html css

IMAGES

Image se place ainsi :<img src="image.png" width="50" height="100" alt="img not visible" title=

On indique :

la source (src)les dimentions en pixelsalt : text alternatif (accessibilité)title : text au survol

Page 24: Initiation html css

DIVsignifiant division du document

<div>

Page 25: Initiation html css
Page 26: Initiation html css
Page 27: Initiation html css

SELECTEURS CSS

Page 28: Initiation html css

IDENTIFIANTS & CLASSESToute balise HTML peut :

id : avoir un identifiant uniqueclass : appartenir à un ou plusieurs groupes

<div id="header" class="main">

Page 29: Initiation html css

Sélecteurs principaux

p#idname.classname

Page 30: Initiation html css

Pseudo-classes

a:hoverul>li:first-child

Page 31: Initiation html css

LE GRAPHISME EN CSS

Page 32: Initiation html css

TEXTE & POLICESPolices

font-style : normal | italic ;font-weight : normal | boldfont-size :12px;font-family :'Tahoma' , 'Arial' , 'sans-serif';

Page 33: Initiation html css

texte

text-align : left | center | right;text-decoration : none | underline| line-throughtext-transform : none | capitalize |uppercase |lowercasefont-family :'Tahoma' , 'Arial' , 'sans-serif';

Page 34: Initiation html css

Listes

list-style-type : disc | circle | square |none;list-style-image : none | url(img.jpg)list-style-position : outside | inside

Page 35: Initiation html css

Couleurs & unités

color : red;

rgb(0,255,0) :red,green,bluered :simple coleur#00FF00 : hexadécimal

Page 36: Initiation html css

Fonds

background-image: url(img.png);background-repeat : repeat |repeat-x|repeat-y|no-repeatbackground-color:rgb(0,255,0);

Page 37: Initiation html css

Bordures et arrondis

border-width:1px;border-style: none |solid |dotted |dashed |doubleborder-color :#FFFFFF;border :1px solid red ;border-radius :5px ;

POSITIONNEMENT

Page 38: Initiation html css

POSITIONNEMENT

position

position:static |relative |fixed |absolute;

Page 39: Initiation html css

margin

margin:10px 10px 10px 10px;margin-left:10px;margin-top:10px;

Page 40: Initiation html css

padding

padding:10px 10px 10px 10px;padding-left:10px;padding-top:10px;

Page 41: Initiation html css

TABLEAUthead : tableau header

tbody : tableau body

tr : indique le début et la fin d'une ligne du tableau

td : indique le début et la fin du contenu d'une cellule

Page 42: Initiation html css

##Example :

<table> <thead> <tr> <th>Item</th> <th>Value</th> <th>Quantity</th> </tr> </thead> <tbody> <tr> <td>Apples</td> <td>$1</td> <td>7</td> </tr> <tr> <td>Lemonade</td> <td>$2</td>

Page 43: Initiation html css

FORMULAIRES

Page 44: Initiation html css

Input<input type="" name="" placeholder="" value=""/>

Page 45: Initiation html css

Type input :

text

checkbox

radio

number

date

email

file

submit

...

Page 46: Initiation html css

##Select box :

<select name="" multiple>

<option value="val1">option1</option>

<option value="val2">option2</option>

</select>

Page 47: Initiation html css

##textarea :

<textarea name="" row="" cols="">

</textarea>

Page 48: Initiation html css

LIENS UTILEShttps://developer.mozilla.org/fr/docs/Web/HTML

https://developer.mozilla.org/fr/docs/Web/CSS

w3schools.com