css caption-side属性定义及用法
1、在css中,caption-side属性是用来规定表格标题的位置,表格标题可以设置在表格之上(默认),也可以设置在表格之下
2、目前所有主流浏览器都支持caption-side属性,但是IE8必须要指定!DOCTYPE才支持
css caption-side属性值
top:表格标题在表格之上(默认)
bottom:表格标题在表格之下
inherit:从父元素继承 caption-side 属性的属性值
语法格式
caption-side:top / bottom / inherit;
实例
<!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>男</t<strong>本文来源gao@daima#com搞(%代@#码@网2</strong>d><td>80</td></tr></table></body></html>
运行结果
以上就是css caption-side属性怎么用的详细内容,更多请关注搞代码gaodaima其它相关文章!