本文摘自php中文网,作者silencement,侵删。

css caption-side属性定义及用法
1、在css中,caption-side属性是用来规定表格标题的位置,表格标题可以设置在表格之上(默认),也可以设置在表格之下
2、目前所有主流浏览器都支持caption-side属性,但是IE8必须要指定!DOCTYPE才支持
css caption-side属性值
top:表格标题在表格之上(默认)
bottom:表格标题在表格之下
inherit:从父元素继承 caption-side 属性的属性值
语法格式
1 | caption-side : top / bottom / inherit;
|
实例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | <!doctype html>
<html>
<head>
<meta charset= "UTF-8" >
<title>css caption-side表格标题属性笔记</title>
<style>
table{ width : 400px ; height : 150px ;}
caption { caption-side : top ;}
</style>
<head/>
<body>
<table border= "1" >
< caption >学生成绩表</ caption >
<tr><th>学号</th><th>姓名</th><th>性别</th><th>成绩</th></tr>
<tr><td> 1 </td><td>张三</td><td>男</td><td> 60 </td></tr>
<tr><td> 2 </td><td>李四</td><td>男</td><td> 80 </td></tr>
</table>
</body>
</html>
|
运行结果

以上就是css caption-side属性怎么用的详细内容,更多文章请关注木庄网络博客!!
相关阅读 >>
Python如何使用xlrd实现读取合并单元格
Python主要用于做什么
java转Python容易吗
Python有eval函数吗
Python中class怎么用
Python对文件操作流程介绍
Python的random怎么用
Python的库有多少个?
Python可用于什么领域?
Python怎么统计文本中的字频
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » css caption-side属性怎么用