日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > CSS >内容正文

CSS

css斑马线表格,用CSS3美化表格

發布時間:2023/12/29 CSS 48 豆豆
生活随笔 收集整理的這篇文章主要介紹了 css斑马线表格,用CSS3美化表格 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
CSS3美化表格

*{margin: 0;padding: 0;}

body {

padding: 40px 100px;

}

.demo {

width: 600px;

margin: 40px auto;

font-family: 'trebuchet MS', 'Lucida sans', Arial;

font-size: 14px;

color: #444;

}

/*表格的默認設置*/

table {

*border-collapse: collapse; /* IE7 and lower */

border-spacing: 0;

width: 100%;

}

/*========制作圓角表格========*/

.bordered {

border: solid #ccc 1px;/*給表格添加邊框*/

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 .highlight,

.bordered tr:hover {

background: #fbf8e9;/*表格行的懸浮狀態效果*/

}

.bordered td,

.bordered th {

border-left: 1px solid #ccc;

border-top: 1px solid #ccc;

padding: 10px;

text-align: left;

}

.bordered th {

/*表格表頭添加漸變背景色*/

background-color: #dce9f9;

background-image: -webkit-gradient(linear, left top, left bottom, from(#ebf3fc), to(#dce9f9));

background-image: -webkit-linear-gradient(top, #ebf3fc, #dce9f9);

background-image: -moz-linear-gradient(top, #ebf3fc, #dce9f9);

background-image: -ms-linear-gradient(top, #ebf3fc, #dce9f9);

background-image: -o-linear-gradient(top, #ebf3fc, #dce9f9);

background-image: linear-gradient(top, #ebf3fc, #dce9f9);

filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ebf3fc, endColorstr=#dce9f9);

-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#ebf3fc, endColorstr=#dce9f9)";

box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;/*表格表頭設置內陰影*/

border-top: none;

text-shadow: 0 1px 0 rgba(255,255,255,.5);/*表格表頭設置文字陰影*/

}

/*使用:first-child去除表格每行的第一個單元格的左邊框*/

.bordered td:first-child,

.bordered th:first-child {

border-left: none;

}

/*使用:first-child設置表格表頭第一個單元格僅左上角為圓角*/

.bordered th:first-child {

border-radius: 6px 0 0 0;

}

/*使用:last-child設置表格表頭最后一個單元格僅右上角為圓角*/

.bordered th:last-child {

border-radius: 0 6px 0 0;

}

/*使用:first-child和:last-child設置表格最后一行的第一個單元格左下角為圓角*/

.bordered tr:last-child td:first-child {

border-radius: 0 0 0 6px;

}

/*使用:last-child設置表格最后一行的最后一個單元格右上角為圓角*/

.bordered tr:last-child td:last-child {

border-radius: 0 0 6px 0;

}

/*=======制作Zebra表格(斑馬線表格)效果==========*/

.zebra td,

.zebra th {

padding: 10px;

border-bottom: 1px solid #f2f2f2;

}

/*使用:nth-child(even)給表格的奇數行添加背景和陰影效果*/

.zebra .alternate,

.zebra tbody tr:nth-child(even) {

background: #f5f5f5;

box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;

}

.zebra th {

text-align: left;

text-shadow: 0 1px 0 rgba(255,255,255,.5);

border-bottom: 1px solid #ccc;

background-color: #eee;

background-image: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#eee));

background-image: -webkit-linear-gradient(top, #f5f5f5, #eee);

background-image: -moz-linear-gradient(top, #f5f5f5, #eee);

background-image: -ms-linear-gradient(top, #f5f5f5, #eee);

background-image: -o-linear-gradient(top, #f5f5f5, #eee);

background-image: linear-gradient(top, #f5f5f5, #eee);

filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#f5f5f5, endColorstr=#eeeeee);

-ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#f5f5f5, endColorstr=#eeeeee)";

}

/*使用 :first-child設置表格表頭第一個單元格左上角為圓角*/

.zebra th:first-child {

border-radius: 6px 0 0 0;

}

/*使用 :last-child設置表格表頭最后一個單元格右上角為圓角*/

.zebra th:last-child {

border-radius: 0 6px 0 0;

}

.zebra tfoot td {

border-bottom: 0;

border-top: 1px solid #fff;

background-color: #f1f1f1;

}

/*使用 :first-child設置表格腳部第一個單元格左下角為圓角*/

.zebra tfoot td:first-child {

border-radius: 0 0 0 6px;

}

/*使用 :last-child設置表格腳部最后一個單元格右下角為圓角*/

.zebra tfoot td:last-child {

border-radius: 0 0 6px 0;

}

?

#IMDB Top 10 MoviesYear

1The Shawshank Redemption19942The Godfather19723The Godfather: Part II19744The Good, the Bad and the Ugly1966

#IMDB Top 10 MoviesYear

1The Shawshank Redemption19942The Godfather19723The Godfather: Part II19744The Good, the Bad and the Ugly1966?

?

總結

以上是生活随笔為你收集整理的css斑马线表格,用CSS3美化表格的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。