1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

HTMLのstrikeタグは使っちゃだめ!

Posted at

プログラミング勉強日記

2020年10月2日
<strike>タグ初めて見て、調べていくと<strike>は使ってはいけないと学んだのでまとめる。

strikeタグとは

 打消し線を引くタグだが、HTML5の仕様では廃止されている。その代わりにdelタグとsタグを使用することが推奨されている。delタグは削除されたテキスト文という意味のマークアップをすることができる。sタグはdelタグとは違い正確ではない・関連性がないテキスト文という意味である。sタグでは削除されたテキストとして定義はできない。

例(HTML)
<p>Hello World</p>
<p><s>Hello World</s></p>
<p><del>Hello World</del></p>
<p><span class="cancel">Hello World</span><p>
例(CSS)
.cancel {
  text-decoration: line-thorough;
}

実行結果は以下のようになる
1002.png

参考文献

打ち消し線を引く
HTMLでstrikeタグを使う注意点を現役デザイナーが解説【初心者向け】

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?