css3 伪类分为:动作伪类、目标伪类、语言伪类、结构伪类、UI元素状态伪类、否定伪类选择器。通过这些伪类选择器,可以实现很多原来需要js才能实现的功能。现在我们来用这些伪类选择器来制作表格。
表格1:
<!DOCTYPE html>
<html lang="en">
<head> <title>表格1</title>
<style>
div.demo{
width:600px;
margin:30px auto;
font-size:14px;
font-family: "微软雅黑";
color:#444;
}
table{
*border-collaspe:collaspe;
border-spacing: 0px;
width:100%;
}
/* 制作圆角表格*/
.bordered{
border:solid 1px #ccc;
border-radius:6px;
box-shadow: 0 1px 1px #ccc;
}
.bordered tr{
-o-transition:all 0.1s ease-in-out;
-webkit-transition:all 0.1s ease-in-out;
-moz-transition:all 0.1s ease-in-out;
-ms-transition:all 0.1s ease-in-out;
transition:all 0.1s ease-in-out;
}
.bordered th,.bordered td{
border-left: 1px solid #cccccc;
border-top:1px solid #cccccc;
padding:10px;
text-align:left;
}
.bordered td{
border-left-color:#fff;
}
.bordered tr:nth-child(n+3) td{