CSS

Aus Claudio's Wiki
Wechseln zu: Navigation, Suche

CSS Syntax

Prinzip:
selector {property: value}

Beispiel:

body {color: black}
oder:
body
{
  text-align: center;
  color: black;
  font-family: arial
}

Gruppierung:

h1,h2,h3,h4,h5,h6 
{
color: green
}

Class-Selector:

p.center
{
  text-align: center
}

Mehrere Class gleichzeitig:

.center
{
  text-align: center
}

ID-Selector:

p#para1
{
text-align: center;
color: red
}

Spezielle Attribute:

input[type="text"]
{
  background-color: blue
}

CSS Comments:

/* This is a comment */
p
{
  text-align: center;
  /* This is another comment */
  color: black;
  font-family: arial
}

Ein paar Links