Home >Web Front-end >CSS Tutorial >css: Detailed explanation of the use of the caption-side attribute (table title position)

css: Detailed explanation of the use of the caption-side attribute (table title position)

黄舟
黄舟Original
2017-06-30 10:44:473021browse

Instance introduction

css caption-sideAttribute(Tabletitle position)

[Basic syntax]

fcaption-side:top|right|bottom|left

[Syntax introduction]

This attribute specifies the placement position of the table title relative to the table frame. The table title is displayed as if it were a block-level element
before (or after) the table.

[Example code]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
caption
{caption-side:bottom}
</style>
</head>
<body>
<table border="1">
<caption>
标题
</caption>
<tr>
<td>李敏</td>
<td>小莉</td>
</tr>
<tr>
<td>国良</td>
<td>秀秀</td>
</tr>
</table>
</body>
</html>
【代码分析】

In the code, the bold part is to set the position of the title at the bottom, as shown in Figure 15.3.

css: Detailed explanation of the use of the caption-side attribute (table title position)

The above is the detailed content of css: Detailed explanation of the use of the caption-side attribute (table title position). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn