(),
. (. 1):
(Selector). , .
, .
(Property). .
: , , , ..
(Value). , .
(Declaration). .
(Rule). ( + ).
, , , . :
[, [,...]] {: ;}
, .
CSS
, HTML. :
1. , 30px, () Serif,
( ) 14px:
p {
text-align: justify;
text-indent: 30px;
font-family: Serif;
font-size: 14px;
}
<p>.
2. :
h1, h2, h3 {
color: blue; /* , #0000FF */
}
3. :
table, img {border: none;}
4. :
li a {text-decoration: none;}
5. (< div >), 10px :
div, th, td {
padding-left: 10px;
padding-right: 10px;
background-color: yellow;
}
6. , , ( a:hover).
a {color: black; font-weight: bold;}
p a, li a {font-weight: normal; text-decoration: none;}
p a:hover, li a:hover {
color: #00FF00; text-decoration: underline;
}
CSS . , , : ?
, , .
|
|
, :
p {margin-left: 0;}
p.warn {margin-left: 40px; color: #FF00;}
class :
<p class=warn> </p>
:
._ {}
, , .
:
:
.solid_blue {color: blue;}
:
<p class=solid_blue> </p>
<li class=solid_blue> </li>
:
h1.bigsans {font-family: Sans; font-size: 1.5em;}
h1.smallserif {font-family: Serif; font-size:.84em;}
:
<h1 class=bigsans>, </h1>
<h1 class=smallserif>, </h1>
, id. , , # (). :
div#content {
position: absolute;
top: 10px;
left: 10%;
right: 10%;
border: solid 1px silver;
}
...
<div id="content"></div>
, .
(grouping) . , . , :
div {
margin-left: 10px;
margin-top: 5px;
margin-right: 40px;
margin-bottom: 15px;
}
:
div {margin: 5px 40px 15px 10px;} /*: top right bottom left*/
.
, padding, font, border, background ..