本文摘自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和c++的区别
如何修改Python字典内的值?2种修改Python字典内的值方法总结
Python利用不到一百行代码实现一个小siri
Python读取word中的文本内容
如何用Python代码温度转换?
scrapy抓取学院新闻报告实例
实例讲解golang模拟实现带超时的信号量
Python标识符的命名规则是什么
使用Python通过win32 com实现word文档的写入与保存方法
Python怎样实现百度语音识别api的步奏详解
更多相关阅读请进入《Python》频道 >>
人民邮电出版社
python入门书籍,非常畅销,超高好评,python官方公认好书。
转载请注明出处:木庄网络博客 » css caption-side属性怎么用