Help:Lint errors/廃止されたタグ

This page is a translated version of the page Help:Lint errors/obsolete-tag and the translation is 63% complete.

廃止されたタグエラーは、非推奨のHTML要素によるものです。[1]

HTML5準拠の目標をどこまで推進したいかは現時点では不明であるため、このカテゴリは優先度が低いとマークされています。 一部のウィキは、すぐに対処しないことを選択する場合があります。 その他のウィキは先に進み、HTML5に準拠したいと思うかもしれません。 一部のウィキは、これに対処するためにボットを作成するかもしれません。 したがって、あなたの判断とwiki固有の方針を使用して、これにどれだけの労力を費やしたいかを案内してください。 将来、この修正をより積極的に追求することがより明確になった場合は、このリンターの問題の重大度を適切に更新することで、それを反映します。

非推奨の要素

現在、非推奨の要素と代替要素は次のとおりです。

非推奨の要素
非推奨のタグ 置換 表示例
‎<center> <div style="text-align: center;">

英語版ウィキペディアでのテンプレートの使用については、w:Wikipedia:HTML 5#Templates を参照してください。
パーサー タグでの使用については、w:Wikipedia:HTML 5#Parser tags を参照してください。
表およびその中のセルでの使用については、w:Wikipedia:HTML 5#Tables を参照してください。

<div style="text-align: center;">Centered</div>
Centered
The div-tag method above does not always center the enclosed content, and sometimes it applies undesired centering to text within the content. This row lists tag-specific and template-specific centering (some of these templates do not exist on some MediaWiki sites; examples are for the English Wikipedia):
  • To center an hr tag:
<hr style="margin: auto;" />
  • To center a table on the page:
{| style="margin: auto;"
<table style="margin: auto;">
  • To center a table cell's contents:
|style="text-align: center;" | Content

or:

<td style="text-align:center">
  • To center text in Template:Tmbox or Template:Editnotice:
|textstyle = text-align: center;
  • To center Template:Tree chart:
{{tree chart/start|align=center}}
  • To center a Gallery tag or template (Doesn't always work; for example, with perrow="5", the gallery will be aligned to the left. Workaround: wrap in wikitable markup instead.):
<gallery class="center">...</gallery>

or:

{{Gallery|style=margin:auto
  • To center the content of a Template:Userbox, if the content is in |info =
 | info-op = text-align: center
  • To center a Template:Location map:
{{location map|float=center}}
  • If all else fails, you can replace the center tags with a table wrapping the entire block:
{| style="margin: auto;"
|
(existing content)
|}
<font color="x" size="y" face="z"> <span style="color: x; font-size: y; font-family: z;"> <span style="color: red;">Red Alert!</span> Red Alert!
<span style="font-family: Times New Roman;">This is Times New Roman</span> This is Times New Roman
‎<strike> ‎<del> (編集をマークするため) <del>Yes</del> No Yes No
‎<s> (その他) Photon Torpedoes <s>$44.99</s> '''now just $24.99!''' each Photon Torpedoes $44.99 now just $24.99! each
‎<tt> ‎<code> (ソースコードに適しています) ノーブレークスペースには<code>&nbsp;</code>を使用します ノーブレークスペースには&nbsp;を使用します
‎<kbd> (利用者入力に適しています) <kbd>mypasswd</kbd> mypasswd
‎<var> (変数に適しています) <var>age</var>=65 age=65
‎<samp> (コンピューター出力に適しています) <samp>Invalid password. Please try again.</samp> Invalid password. Please try again.
Use the template {{mono}} for all other monospaced text on Wikipedia in English and many other languages. If the template is not available, use:

<span style="font-family: monospace, monospace;">

"monospace, monospace" is a workaround for a bug in some browsers; see en:Wikipedia:Typography#The monospace "bug" for details.
<span style="font-family: monospace, monospace;">Typed text</span> Typed text
Table cell horizontal alignment: align=X
where X is "left", "center" or "right" (sometimes without quotes)
Note: As of November 2020, Linter doesn't detect this obsolete HTML.
style="text-align: X;" style="text-align: right;" | right-justified text right-justified text
Table cell vertical alignment: valign=X
where X is "top", "middle" or "bottom" (sometimes without quotes)
Note: As of November 2020, Linter doesn't detect this obsolete HTML.
style="vertical-align: X;" style="vertical-align: top;" | top aligned text top aligned text
Table cell background color: bgcolor=X
Note: As of November 2020, Linter doesn't detect this obsolete HTML.
style="background-color: X;" style="background-color: pink" | pink background pink background


フォント サイズ

  • "font size=0"は無効なHTMLである、"font size=1"と同じになります。.
  • "font size=2.5" または1から7の十進数は、パーセントまたはemマークアップで実現できる中間のフォントサイズを生成します。
  • 7を超える値は7と同等に扱われます。パーセントまたはemのサイズはおおよその一致であり、ブラウザやその他の要因にわずかに依存する場合があります。
  • プラスまたはハイフンで始まるフォントサイズ。例えば <font size=+2>または<font size=-1>は、3のプラスマイナスの数に相当します。
<font size=...> <span style="font-size: ...;"> <span style="font-size: ...;">
when base font size is 14px
font-size:xx-small
font-size:9px
font-size: 64%
font-size: 0.64em
font size=0,
font size=1
font-size:x-small
font-size:10px
font-size: 71%
font-size: 0.71em
font size=2 font-size:small
font-size:13px
font-size: 93%
font-size: 0.93em
font size=3 font-size:medium
font-size:16px
font-size: 114%
font-size: 1.14em
font size=4 font-size:large
font-size:18px
font-size: 129%
font-size: 1.29em
font size=5 font-size:x-large
font-size:24px
font-size: 171%
font-size: 1.71em
font size=6 font-size:xx-large
font-size:36px
font-size: 229%
font-size: 2.29em
font size=7,
font size>=7
font-size:xxx-large
font-size:48px
font-size: 343%
font-size: 3.43em

マルチビッグ

‎<big>...‎</big> <span style="font-size:...">...</span>
1 big font-size:120%
2 big font-size:150%
3 big font-size:175%
4 big font-size:200%
5 big font-size:250%
6 big font-size:300%

理論的根拠

MediaWiki currently whitelists these elements, and they tend to be output the same way as input. This means that when browser vendors decide to remove these they will simply display as regular undecorated text. Examples of some "popular" html tags that had visual effects and have been removed from major browsers include ‎<blink>[2] and ‎<basefont>[3]. A further problem is that different browser vendors may remove them independently so editors or readers may have inconsistent views of the same page, leading to confusion.

It is likely that browser vendors will give us significant notice before making any breaking changes given how prevalent these deprecated elements are used across the internet.

Helpful hints

<font color="x"> accepts numeric font colors without the standard hash prefix. However, with <span style="color: x;">, the hash before numeric font colors is mandatory:

Markup Display
<font color="#FF0000">Red</font> Red
<font color="FF0000">Red</font> Red
<span style="color: #FF0000;">Red</span> Red
<span style="color: FF0000;">Red</span> Red

<font color="x"> accepts some nonstandard font color names such as burntorange and vermillion, which are not on the list of 16 HTML colors or the list of 124 X11 colors. The replacement <span style="color: ..."> markup recognizes only color names on these lists.

<font color="x"> accepts 4-digit and 5-digit hexadecimal codes, which need 00 and 0, respectively, appended in <span style="color: ..."> markup. Hexadecimal codes with more than 6 digits need to be trimmed to the first 6 digits.

font markup font display span markup span display
<font color="#FF88">Hello</font> Hello <span style="color: #FF8800;">Hello</span> Hello
<font color="#D0208">Hello</font> Hello <span style="color: #D02080;">Hello</span> Hello
<font color="#D020808">Hello</font> Hello <span style="color: #D02080;">Hello</span> Hello
<font color="#D020808F">Hello</font> Hello <span style="color: #D02080;">Hello</span> Hello
<font color="#D020808F0">Hello</font> Hello <span style="color: #D02080;">Hello</span> Hello


Tools

The following tools can help fix obsolete HTML tags:

Obsolete tags may be reported by WPCleaner as part of CheckWiki error #541.

脚注