css caption-side attribute definition and usage
1. In css, the caption-side attribute is used to specify the position of the table title. , the table title can be set above the table (default) or below the table
2. Currently, all mainstream browsers support the caption-side attribute, but IE8 must specify !DOCTYPE to support it
css caption-side attribute value
top: The table title is above the table (default)
bottom: The table title is below the table
inherit: inherit the attribute value of the caption-side attribute from the parent element
Syntax format
caption-side:top / bottom / inherit;
Example
<!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>
operation result
The above is the detailed content of How to use css caption-side attribute. For more information, please follow other related articles on the PHP Chinese website!