1. 程式人生 > >優秀css案例欣賞

優秀css案例欣賞

*{
margin: 0;
padding: 0;
list-style: none;
}


body{
background: #E7EAEC;
font-size: 12px/1.5 tahoma, arial, "Hiragino Sans GB";
color: #666;
background: #E7EAEC;
}


a {
color: #42A6F5;
text-decoration: none;
}


a:hover{
color: #2196F3;
}


aside{
background: #373737;
position: absolute;
left: 0;
height: 100%;/*怎麼起作用了?*/
width: 200px;
padding-top: 20px;
}


.container{
margin-left: 200px;
}


header {
/*width: 100%;預設值就是100%*/
height: 40px;
background: #fff;
font-size: 14px;
padding: 0 15px;
}


.main{
margin: 15px;
}


.row {
width: 100%;
overflow: hidden;/*清除浮動的黑科技,或者clear:both;*/
}


.col {
float: left;
}


.col-12{
width: 100%;
}


.col-7{
width: 58.3%;
}


.col-5{
width: 41.6%;
}


aside a {
display: block;
padding: 10px 10px 10px 40px;
color:#ccc;
}


aside .current a{
background: #00B6E3;
color: #fff;
}


.header-nav {
float: right;
/*line-height: 40px;放在這裡或者放在下面*/
}


.header-nav >li {
/*或者float: left;也可以*/
display: inline-block;/*此時有個4px的間隔*/
/*position: relative;*/
line-height: 40px;/*對齊的好辦法,沒有它浮出框也不會與header的下邊界對齊*/
padding: 0 25px;
}


.header-nav >li> a {
/*display: block;*/
/*padding: 0px 25px;與上面的等價*/
}


.drop-list {
z-index: 1;
display: none;
position: absolute;
background: #fff;
border-radius: 3px;
border: 1px solid #ddd;
width: 100px;
font-size: 12px;
}


.header-nav li:hover{
background: #f9f9f9;
}


.header-nav>li .drop-list{
/*right: 0;*/
}


.header-nav li:hover .drop-list {
display: block;
}


.drop-list a {
display: block;
padding: 5px 20px;
line-height: 1.5em;
}


.drop-list li:hover {
background: #f9f9f9;
}


.box {
background: #fff;
margin: 0 15px 15px 0;
padding: 15px;
min-height: 50px;
position: relative;
}


.box h3{
font-size: 14px;
color: #777;
}


.col:last-child .box{
margin-right: 0;
}


.box .refresh {
position: absolute;
top: 15px;
right: 15px;
}


.application .overview {
float: left;
width: 33.3333%;
padding: 10px 0;
}
/*清除浮動的常規做法*/
.application:after{
display: table;
clear: both;
content: "";
}


.overview-main{
font-size: 14px;
margin-bottom: 3px;
}


.overview-number{
font-size: 26px;
margin: 0 .3em;
}


.overview-other{
color: #999;
}


.hero-item {
position: relative;
border-bottom: 1px dashed #ddd;
padding-bottom: 10px;
margin-top: 10px;
color: #999;
line-height: 26px;
}


.hero-time{
position: absolute;
top: 0;
right: 0;
}


.hero-content {
color: #333;
/*font-size: 10px;*/
/*margin-bottom: 5px;*/
}


.hero-item:last-child{
border: none;
}