Vous êtes sur la page 1sur 1

BASICCSSCHEATSHEET(CSS2.

1RULESWITHINTERNALSTYLESHEET)
THEINTERNALSTYLESHEET

SOMESTYLEDECLARATIONS

<html>

DeclarationstellCSSHOWyouwanttostyle.

<head>
<style type="text/css">
body {
background-color: black;
color: white;
}
h1 {
color: green;
font-family: Arial;
}
</style>
</head>

FOREGROUND/FONTCOLOR
{color: blue;}

BACKGROUNDCOLOR
{background-color: blue;}

FONTS
{font-family:"Times New Roman",
Times, serif;}
{font-family: Arial, Helvetica,
sans-serif;}

{font-style:normal;}
{font-style:italic;}

<body>
<h1>Most important heading</h1>
</body>

{font-size:40px;}

</html>

{font-weight: bold;}

TEXT

CSSSYNTAX

{text-align:center;}
{text-align:right;}
{text-align:justify;}

{text-decoration:underline;}
{text-transform:uppercase;}
{text-transform:lowercase;}
Graphicfromw3schools {text-transform:capitalize;}

MARGINSANDPADDING

CSSSELECTORS

{margin-top: 10px;}
{margin-right: 10px;}
{margin-bottom: 10px;}
AnHTMLelement.Forexample:p {}orbody {} {margin-left: 10px;}
orh2{}
{padding-top: 10px;}
TheClassselectorwhichstartswitha.(period).For {padding-right: 10px;}
example to select <p class=style1> the {padding -bottom: 10px;}
{padding -left: 10px;}
selectorwouldbe .style1

SelectorstellCSSWHATyouwanttostyle.Itcanbe:

BORDERS

TheIDselectorwhichstartswitha#(numbersign).
{border: black solid 1px;}
For example to select <p id=style1> the

selectorwouldbe #style1

FLOATS

Note: each class can be used many times in a document {float:right; width: auto;}
{float:left; width: auto;}
whileeachIDshouldonlybeusedonce.

13December2010

Vous aimerez peut-être aussi