<h1 align="行揃え位置>文字列</h1>‥‥h1〜h6で利用できます
<p align="行揃え位置>文字列</p>
<div align="行揃え位置>文字列</div>
行揃え位置‥‥left . right . center
<p align="行揃え位置>文字列</p>
<div align="行揃え位置>文字列</div>
行揃え位置‥‥left . right . center
要素名 | 属性名 | 説明 | 非推奨 | 必須属性 |
---|---|---|---|---|
h1 p div | 見出し 段落 範囲の指定 | |||
align | 行揃え位置 | 非推奨 | ||
class | クラス名 | |||
id | ID名 | |||
title | 補足情報 | |||
style | スタイルシート | |||
lang | 言語コード | |||
dir | 文字表記の方向 |
align属性を利用すると、見出し(h1〜h6要素)、段落(p要素)、指定した範囲(div要素)の行揃えを指定できます。
値には、left 又は right 又は centerを指定します。
ただし、align属性は、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>
<h1 align="left">左揃えです</h1>
<p align="center">
センター揃えです。
センター揃えです。
センター揃えです。<p>
<div align="right">
右揃えです。
右揃えです。
右揃えです。<div>
</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>
<h1 align="left">左揃えです</h1>
<p align="center">
センター揃えです。
センター揃えです。
センター揃えです。<p>
<div align="right">
右揃えです。
右揃えです。
右揃えです。<div>
</body>
</html>
Internet Explorer8での表示例
