CSS TUTORIALS - CSS - Syntax
CSS - Syntax
ADVERTISEMENTS
selector { property: value }
|
ADVERTISEMENTS
table{ border :1px solid #C00; }
|
ADVERTISEMENTS
The Type Selectors:
The Universal Selectors:
The Descendant Selectors:
ul em {
color: #000000;
}
|
The Class Selectors:
.black {
color: #000000;
}
|
h1.black {
color: #000000;
}
|
<p class="center bold">
This para will be styled by the classes center and bold.
</p>
|
The ID Selectors:
#black {
color: #000000;
}
|
h1#black {
color: #000000;
}
|
#black h2 {
color: #000000;
}
|
The Child Selectors:
body > p {
color: #000000;
}
|
The Attribute Selectors:
input[type="text"]{
color: #000000;
}
|
h1 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}
|
h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}
|
#content, #footer, #supplement {
position: absolute;
left: 510px;
width: 200px;
}
|