方法:1、用“表格元素{border -t op-color:transparent}”语句设置上 边框颜色 透明,进而隐藏表格上边框;2、用“表格元素{border-top -s tyle:none}”语句让表格元素没有上边框,也就是隐藏表格上边框。
本教程操作环境:windows10系统、CSS3 && HT ML 5版、Dell G3 电 脑。
css 怎样 隐藏表格上边框
1、在css中,想要隐藏表格的上边框,可以 利用 border-top-color属性,将表格上边框的颜色设置为透明即可。
border-top-color 用于设置元素的上边框的颜色。
示例如下:
<!DOCTY PE html>
<html lang="en">
<head>
< ;m eta charset="UTF-8">
<meta n am e="viewport" content="width=device-width, in IT ial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie= Edge ">
<title>Document</title>
<style>
table{
border-top-color:transparent;
}
</style>
<table border="1">
<tr>
<td>111</td>
<td>222</td>
</tr>
<tr>
<td>333</td>
<td>444</td>
</tr>
<tr>
<td>555</td>
<td>666</td>
</tr>
<tr>
<td> 777 </td>
<td>888</td>
</tr>
</table>
</body>
</html>输出结果:
2、在css中,还可以利用border-top-style属性来设置元素上边框的样式。
当属性值为none时,定义元素没有上边框。
示例如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
table{
border-top-style:none;
}
td{
border-top-style:none;
}
</style>
<table border="1">
<tr>
<td>111</td>
<td>222</td>
</tr>
<tr>
<td>333</td>
<td>444</td>
</tr>
<tr>
<td>555</td>
<td>666</td>
</tr>
<tr>
<td>777</td>
<td>888</td>
</tr>
</table>
</body>
</html>输出结果:
(学习视频分享:css视频教程)
以上就是css怎样隐藏表格上边框的详细内容,更多请关注其它相关 文章 !
总结
以上是 为你收集整理的 css怎样隐藏表格上边框 全部内容,希望文章能够帮你解决 css怎样隐藏表格上边框 所遇到的问题。
如果觉得 网站内容还不错, 推荐好友。
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did200479