You are on page 1of 2

Utilisation CSS

Methode 1 :
<head>
<style> ... </style>
</head>

Methode 2 :
<p style="...">

Methode 3 :
<link rel="stylesheet" href="..."/>

Forme de code CSS


selecteur {
propriété : valeurs;
}

* {} modification sur l ensemble de la page


.class {} modification sur class
#id {} modification sur id
b1, b2 {} modification sur b1 et b2
b1 b2 {} modification sur b2 situe dans b1
b1 + b2 {} modification sur b2 suivant b1
b1[attr1] {} modification sur b1 dont l attribut attr1

Propriete
color : (#...... | rgb(...,...,...) | ...);

-Font :
font-family : (sans-serif | serif | monospace | cursive | fantasy);
font-size : (..px | ..cm | ..mm);
font-style : (normal | italic);
font-height : (normal | bold);
font-variante : (normal | small-caps);

-Text
text-align : (left | right | center | justify);
text-decoration : (none | underline | line-through | overline);
text-transform : (none | capitalize | uppercase | lowercase);
text-indent : (..px | ..cm | ..mm);

-Fond
background-color : *color*;
background-image : url("...");
background-repeat : (no-repeat | repeat-x | repeat-y | repeat);
background-position : (..px ..px | top | right | left | bottom); /* il est possible
de combiné des mots */
background-size : (..px ..px | ..% ..% | auto);

-Liste
list-style-type : url("...");
list-style-image : url("...");

-Bordure
border-color : *color*;
border-width : (..px);
border-style : (solid | double | dotted | dashed | inset | outset | groove |
ridge);
border-radius : (..px);

-Autre
line-height : (normal | ..px | ..% | ..);
overflow-x : (visible | hidden | scroll | auto);
overflow-y : (visible | hidden | scroll | auto);
cursor : (crosshair | pointer | progress | help | wait | auto);

You might also like