A, introduced in HTML css
1, between the lines style
<div style=" "></div>
2, page level css
<head>
<style type="text/css">
div{ }
</style>
3, external css file
<head>
<Link rel = "stylesheet" type = "text / css" href = "css file address">
Asynchronous simultaneously: (asynchronous loading)
Synchronization: carrying a load under a
Second, the selector
1, id: correspondence (id only one value)
<div id="a1"></div>
the css # a1 {}
2, class-many
(1)<div class="demo"></div>
<div class="demo"></div>
(2)<div class="demo,demo1"></div>
3, the tag selector
div{ }
span{ }
4, Tsuhaifu
* (Any meaning, that all tabs)
*{ }
5, attribute selector
[id="b1",style=" "]{ }
6, (1) parent-child selector
<div>
<span>
<p>
</p>
</span>
</div>
div span{ }
div p{ }
(2) direct child element selector
1)<div>
<em> 1 </em>
<span> <em> 2 </em> </span>
</div>
div> em {} (modified to 1)
2) selection div ul li a em (right to look to the left)
(3) packet selector
<em>1</em>
<strong>2</strong>
<span>3</span>
em,strong,span{ }
7, the pseudo-class selector
<a href=" "></a>
a:hover{ }
Third, property
1、font
font-size: font size, the default is 16px
font-weight: lighter normal bold bolder (font weight)
100 200~~900
font-style: italic (italic)
font-family (Font): arial
color (font color):
2, background (css background)
background-color (background color)
background-image (background image)
background-repeat (If you do not want the picture tile, you can use this property)
background-attacment:
background-position (the starting position of the background image is provided)
3, border (border)
border:1px solid black
border-width border-style border-color
4, text-align (alignment) : Center, right, left
5, line-height (the height of the text)
6, text-indent (text-indent) : 1em;
1em=1*font-size
7, text-Decoration : none (no underline), underline (underscore)
8, Cursor : Pointer (forearm)
Fourth, the box model