~~~
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/**
* a:所有状态下都有的样式
*/
a
{
color:black;
text-decoration:none ;
}
/**
* 超链接的伪类需要有顺序: link, visited, hover, active
*/
a:link
{
font-size: 18px;
}
a:visited
{
background: transparent;
}
/**
* hover:悬停,光标移动到身上
*/
a:hover
{
background: dodgerblue;
font-size: 16px;
}
/**
* active:光标点下未抬起
*/
a:active
{
background-color: yellow;
font-size: 16px;
}
#div1
{
width:100px;
height:100px;
border:1px solid blue;
}
#div1:hover
{
background-color: blue;
}
#div1:active
{
background-color: yellow;
}
/**
* css2规范:伪类和伪对象:
* css3规范:伪类: 伪对象::
*
* html4-> html5
* css2 -> css3
* 原则:高版本兼容低版本,向下兼容
*/
#p1::first-letter
{
color:red;
}
#p1::first-line
{
background-color: pink;
}
</style>
</head>
<body>
<a class="blink" href="http://www.baidu.com">百度</a>
<div id="div1"></div>
<p id="p1">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam molestias amet nostrum repellendus culpa facere voluptate ab nisi nemo vel ipsum aliquam accusamus commodi. Saepe repudiandae sapiente iste magnam. Provident?</p>
</body>
</html>
~~~