核心属性
border-collapse: collapse 表格的边框会合并为一个单一的边框
tr:not(:last-child) 选择除了表格的最后一行
-
<table id=jaeger-specs>
-
<caption>机甲规格表</caption>
-
<thead>
-
<tr>
-
<th></th>
-
<th scope=col>国家
-
<th scope=col>高度<span> (米)</span>
-
<th scope=col>重量<span> (吨)</span>
-
</tr>
-
</thead>
-
<tbody>
-
<tr>
-
<th scope=row>Gipsy Danger
-
<td>美国
-
<td>79
-
<td>1980
-
</tr>
-
<tr>
-
<th scope=row>Striker Eureka
-
<td>澳大利亚
-
<td>76
-
<td>1850
-
</tr>
-
<tr>
-
<th scope=row>Crimson Typhoon
-
<td>中国
-
<td>76
-
<td>1722
-
</tr>
-
<tr>
-
<th scope=row>Coyote Tango
-
<td>日本
-
<td>86
-
<td>2312
-
</tr>
-
<tr>
-
<th scope=row>Cherno Alpha
-
<td>俄罗斯
-
<td>85
-
<td>2412
-
</tr>
-
</tbody>
-
</table>
-
#jaeger-specs { -
border-collapse: collapse;
-
margin: 3rem auto;
-
}
-
#jaeger-specs caption { -
margin-bottom: 2rem;
-
font-size: 2rem;
-
font-family: "SimHei", sans-serif;
-
}
-
#jaeger-specs td,
-
#jaeger-specs th { -
text-align: center;
-
padding: 1.5rem;
-
}
-
#jaeger-specs th[scope] { -
color: #fff;
-
background-color: #000;
-
font-weight: normal;
-
}
-
#jaeger-specs tbody { -
border: 1px solid #222;
-
}
-
#jaeger-specs tbody th,
-
#jaeger-specs tbody th + td { -
text-align: left;
-
font-weight: normal;
-
}
-
#jaeger-specs tbody th { -
font-size: 1.1rem;
-
border-right: 1px solid #222;
-
background-size: cover;
-
font-family: Agency, Arial, sans-serif;
-
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
-
}
-
#jaeger-specs tbody tr:nth-child(1) th { -
background: url(https://pics.codecolor.cn/responsive-data-grid/gipsy-danger.jpg);
-
}
-
#jaeger-specs tbody tr:nth-child(2) th { -
background: url(https://pics.codecolor.cn/responsive-data-grid/striker-eureka.jpg);
-
}
-
#jaeger-specs tbody tr:nth-child(3) th { -
background: url(https://pics.codecolor.cn/responsive-data-grid/crimson-typhoon.jpg);
-
}
-
#jaeger-specs tbody tr:nth-child(4) th { -
background: url(https://pics.codecolor.cn/responsive-data-grid/coyote-tango.jpg);
-
}
-
#jaeger-specs tbody tr:nth-child(5) th { -
background: url(https://pics.codecolor.cn/responsive-data-grid/cherno-alpha.jpg);
-
}
-
#jaeger-specs tbody tr:not(:last-child) { -
border-bottom: 1px solid #222;
-
}
-
#jaeger-specs thead th[scope] { -
border: 1px solid #222;
-
border-bottom: none;
-
}
-
#jaeger-specs tbody td:not(:last-child) { -
border-right: 1px solid #222;
-
}
-
#jaeger-specs tbody td { -
background: hsl(195, 100%, 20%);
-
color: #fff;
-
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
松本行弘的程序世界
松本行弘 / 柳德燕、李黎明、夏倩、张文旭 / 人民邮电出版社 / 2011-8 / 75.00元
《松本行弘的程序世界》是探索程序设计思想和方法的经典之作。作者从全局的角度,利用大量的程序示例及图表,深刻阐述了Ruby编程语言的设计理念,并以独特的视角考察了与编程相关的各种技术。阅读《松本行弘的程序世界》不仅可以深入了解编程领域各个要素之间的关系,而且能够学到大师的思考方法。 《松本行弘的程序世界》面向各层次程序设计人员和编程爱好者,也可以供相关技术人员参考。一起来看看 《松本行弘的程序世界》 这本书的介绍吧!