HTML <del>タグ
例
削除された部分と新しい挿入された部分を含むテキスト:
<p>My favorite color is <del>blue</del> <ins>red</ins>!</p>
以下の「自分で試してみてください」の例をもっと見てください。
定義と使用法
<del>
タグは、ドキュメントから削除されたテキストを定義します。ブラウザは通常、削除されたテキストを一線を画します。
ヒントと注意
ヒント:挿入されたテキストをマークアップするには、 <ins>タグも確認してください。
ブラウザのサポート
Element | |||||
---|---|---|---|---|---|
<del> | Yes | Yes | Yes | Yes | Yes |
属性
Attribute | Value | Description |
---|---|---|
cite | URL | Specifies a URL to a document that explains the reason why the text was deleted/changed |
datetime | YYYY-MM-DDThh:mm:ssTZD | Specifies the date and time of when the text was deleted/changed |
グローバル属性
この<del>
タグは、HTMLのグローバル属性もサポートしています。
イベント属性
この<del>
タグは、HTMLのイベント属性もサポートしています。
その他の例
例
CSSを使用して<del>と<ins>のスタイルを設定します。
<html>
<head>
<style>
del {background-color:
tomato;}
ins {background-color: yellow;}
</style>
</head>
<body>
<p>My favorite color is <del>blue</del> <ins>red</ins>!</p>
</body>
</html>
関連ページ
HTML DOMリファレンス:Del Object
デフォルトのCSS設定
ほとんどのブラウザは<del>
、次のデフォルト値で要素を表示します。
例
del {
text-decoration: line-through;
}