Feuilles de styles Css
Redéfinir
les balises HTML :
|
p
{ font-family: Verdana; font-size: 10px} |
|
Lier
une page avec une feuille de styles externe: |
<LINK href="fstyle.css" rel="stylesheet" type="text/css"> |
|
Créer
une classe : |
.encadre
{ border: 1px solid #FF0000} |
|
Appliquer une classe à une balise : |
<p
class="encadre">Mon paragraphe</p> |
|
Appliquer
une classe à une partie de texte : |
<p>Ceci est un texte <span class="surlignage">surligné</span>. Suite</p> |
|
Définition
de classes dans une page : <style> .classe1 {……} .classe2 {……} …. </style> |
<style> .encadre { border: 1px solid #FF0000} .surlignage {background-color: #FFFF99} </style> |
|
Définition de css dans une balise html: <balise style="{…}"> |
<table width="300" border="0" cellpadding="1" cellspacing="1" bgcolor="#FFFFFF" style="{border:1px solid black}"> | |
font-family:
police |
Définit la police |
font-family:
Verdana |
border
: taille
dotted/dashed/solid couleur |
Bordure |
border: 1px solid #000000;
|
margin nombre ou % ou auto |
Marges |
margin-left:50px margin-left:10% |
padding:
nombre ou % |
Remplissage |
padding: 20px; padding: 10px 20px 10px 20px; border: dashed silver 1px ;width:300 |
text-indent: nombre ou % |
Retrait 1ere ligne paragraphe |
text-indent :20px |
text-align: justify/left/right |
text align:justify |
|
line-height: hauteur ou % |
Hauteur des lignes |
Line-height :13px |
float : none/left/right |
Images ou tableaux flottants. |
float:right;margin-left:20px |
background-color:
couleur ou transparent |
Couleur de fond |
background-image: url(cegos.gif); background-attachment: fixed;background-repeat: no-repeat; background-position: center center |
text-decoration: none/underline/overline/ line-through |
Soulignement ,surlignement, barré |
|
text-transform: none/capitalize/uppercase/ lowercase |
Transforme l’affichage des caractères |
text-transform: capitalize |
list-style-type:
upper-roman/lower-roman/upper-alpha/lower-alpha/decimal/square/circle/disc |
Liste à puces avec A,a,I,i,1,carré, cercle, disque. |
List-style-type :decimal |
vertical-align: baseline/ sub/ super/ top/ text-top/middle/ bottom/ text-bottom |
Alignement vertical |
vertical-align: sub;font-size:10px vertical-align: super; font-size: 12px |
width: largeur
ou % |
Largeur |
font-family: Verdana;font-size: 12px;border: 1px dotted #000000 ;width:30%; |
word-spacing :
normal ou nombre |
Espacement mots |
|
Cursor: auto/crosshair/hand /pointer/ move/text/ wait/help |
Forme du curseur |
cursor:wait |
Position:
absolute/relative |
|
<span id="moncalque" style="position:absolute; left:150px; top:50px; width:140px; height:68px; z-index:1;
overflow: visible; clip: rect(50 200 200 50);"><img src="images/deauville.jpg"
width="291" height="194"></span> |
a:link
{ } |
Redéfinit les couleurs des liens hyper-textes. |
a:link
{ font-family: Verdana; font-size: 11px; color: #000000; text-decoration:
none} |
scrollbar-arrow-color:couleur s crollbar-base-color:couleur |
<body style="{scrollbar-arrow-color:black;scrollbar-base-color:ffff00;}"> | |
Exemples de CSS: |
Tableau encadré: |
<INPUT
class="bouton"> |
Couleurs: |