<center>文字列、表、画像</center>
要素名 | 属性名 | 説明 | 非推奨 | 必須属性 |
---|---|---|---|---|
center | 中央揃え | 非推奨 | ||
class | クラス名 | |||
id | ID名 | |||
title | 補足情報 | |||
style | スタイルシート | |||
lang | 言語コード | |||
dir | 文字表記の方向 |
center要素は、指定した要素を中央揃えで表示します。ブロックレベル要素、インライン要素を問わずほとんどの
要素を中央揃えする事ができます。
ただし、center要素は、HTML4.01では非推奨です。中央揃えをする時は、スタイルシートを利用して下さい。
Sample
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>センタリングする。</title>
</head>
<body>
<center>
<p>center要素は、表でも画像でも何でもセンタリングします。
<table border rules="cols" bordercolor="red">
<tr><td>センタリング</td><td>表もセンタリング</td></tr>
</table>
</p>
</center>
</body>
</html>
<html lang="ja">
<head>
<base href="http://www.abcd.com/efg/index.html">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="author" content="制作者名">
<meta name="description" content="内容の紹介">
<meta name="keywords" content="キーワード1,キーワード2,キーワード3,・・・">
<link rel="start" href="start.html">
<link rel="index" href="index.html">
<title>センタリングする。</title>
</head>
<body>
<center>
<p>center要素は、表でも画像でも何でもセンタリングします。
<table border rules="cols" bordercolor="red">
<tr><td>センタリング</td><td>表もセンタリング</td></tr>
</table>
</p>
</center>
</body>
</html>
Internet Explorer8での表示例
