Help:HTML in wikitext: Difference between revisions

Content deleted Content added
m Text replacement - "CSS" to "Wikipedia:CSS"
 
(17 intermediate revisions by the same user not shown)
Line 23:
* <code>dir</code>: text direction— <code>"ltr"</code> (left-to-right), <code>"rtl"</code> (right-to-left) or <code>"auto"</code>.
* <code>id</code>: unique identifier for the element.
* <code>lang</code>: primary language for the contents of the element per [[Wikipedia:BCP 47|BCP 47]]. The MediaWiki software automatically adds the <code>xml:lang</code> attribute whenever <code>lang</code> is defined, but <code>xml:lang</code> will no longer be passed when included as a separate attribute.
* <code>style</code>: applies CSS styling to the contents of the element.
* <code>title</code>: advisory information associated with the element.
Line 66:
==== h1, h2, h3, h4, h5, h6 ====
{{see|Wikipedia:Help:Section|Wikipedia:MOS:HEAD}}
The {{tag|h1}} through {{tag|h6}} tags are headings for the sections with which they are associated. {{tag|h1|o}} is used for the article title. Headings are [[Wikipedia:Help:Cascading Style Sheets#Wiki headings|styled through CSS]] and added to the page's [[Wikipedia:Help:table of contents|table of contents]].
 
{{markup
Line 265:
 
==== code ====
{{tag|code}} formats a section of computer code. Styled with [[Wikipedia:Cascading Style Sheets|CSS]] through {{elements.css}} as a monospaced slab serif typeface with border.
 
{{markup
Line 376:
===== HTML entities =====
 
{{tag|pre|o}} parses [[Wikipedia:Character encodings in HTML|HTML entities]]. If you want to escape this, replace <code>&</code> with <code>&amp;amp;</code>, or use {{xtag|source|params = lang="text"}} instead.
 
{{markup
Line 418:
 
[[Wikipedia:MOS:QUOTATIONS]] says Wikipedia should instead use "", {{tl|quote}}, or <nowiki><blockquote></nowiki>.
 
==== rp, rt, ruby ====
 
{{see|Ruby character}}
 
{{tag|ruby}} marks spans of phrasing content with ruby annotations.
 
{{tag|rt}} marks the ruby text component of a ruby annotation; the ruby text shows in a reduced size over top of the normal characters.
 
{{tag|rp}} is used to provide parentheses around a ruby text component of a ruby annotation, to be shown by user agents that don’t support ruby annotations.
 
Browsers that do not support ruby characters will show the ruby text in normal size, enclosed in parentheses and after the normal content.
 
{{markup
|<nowiki><ruby>
東<rp>(</rp><rt>とう</rt><rp>)</rp>
京<rp>(</rp><rt>きょう</rt><rp>)</rp>
</ruby></nowiki>
|<ruby>
東<rp>(</rp><rt>とう</rt><rp>)</rp>
京<rp>(</rp><rt>きょう</rt><rp>)</rp>
</ruby>
}}
 
Templates:
* {{tlx|ruby}}
* {{tlx|ruby-ja}} for Japanese
* {{tlx|Ruby-zh-p}} for Chinese pinyin
* {{tlx|Ruby-zh-b}} for Chinese bopomofo
 
==== s ====
Line 571 ⟶ 542:
 
==== wbr ====
{{see|Wikipedia:Help:Line-break handling#&lt;wbr /&gt; and soft hyphens}}
{{tag|wbr|o}} is a word break opportunity; that is, it specifies where it would be OK to add a line-break where a word is too long, or it is perceived that the browser will break a line at the wrong place.
 
Line 661 ⟶ 632:
 
==== div ====
{{see|Wikipedia:Span and div}}
{{tag|div}} is a generic container for flow content that displays as a block element.
 
Line 670 ⟶ 641:
 
==== span ====
{{see|Wikipedia:Span and div}}
{{tag|span}} is a container for flow content that displays as an inline element.
 
Line 801 ⟶ 772:
=== a ===
{{details|Help:Wiki markup#Links and URLs}}
{{tag|a|o}} is used to create links. Use the <code><nowiki>[[ ]]</nowiki></code> wikimarkup for internal/intrawiki links and [[Wikipedia:interwiki links|interwiki links]], and <code><nowiki>[ ]</nowiki></code> for external links.
 
=== input ===
{{details|mwmediawikiwiki:Extension:InputBox}}
{{tag|input|o}} is used to create [[Wikipedia:Form (HTML)|forms]]. The {{xtag|inputbox}} extension tag is used to create a text box with a button.
 
== HTML Tidy ==
[[Wikipedia:HTML Tidy]] is an outdated HTML4 library that is [[:mw:Parsing/Replacing Tidy|slated for removal]]. Tidy parses the MediaWiki output and cleans it up to increase the likelihood that valid HTML4 is rendered. For example, with Tidy enabled, {{tag|br|o}}, {{tag|br|c}}, {{tag|br/|o}}, {{tag|br.|o}} all rendered as {{tag|br|s}}. Tidy is not enabled for [[Wikipedia:Help:MediaWiki namespace|MediaWiki interface pages]]. Tidy was never perfect and has been known to introduce errors.
 
== Exceptions ==
In some pages in the [[Wikipedia:Help:MediaWiki namespace|MediaWiki namespace]], typically the short messages like button labels, HTML is not parsed, and tags will be exposed.
 
User and sitewide [[Wikipedia:CSS]] and [[Wikipedia:JavaScript]] pages are interpreted as if inside a {{tag|pre|o}} block. See [[Wikipedia:Help:User style|Help:User style]].
 
== Validation ==
{{Main|Wikipedia:Help:Markup validation}}
The MediaWiki software attempts to fix HTML errors, but it does not catch all of them. Where HTML is used, it is helpful to verify it with the [[Wikipedia:W3C Markup Validation Service|W3C Markup Validation Service]].
 
== Parser and extension tags ==
{{shortcut|Help:Extension tag|Help:Parser tag}}
{{#section:Template:Xtag/doc|xtag}}
 
Line 837 ⟶ 807:
* HTML 4.01 specification: [http://www.w3.org/TR/html401/index/elements.html elements] | [http://www.w3.org/TR/html401/index/attributes.html attributes]
* HTML 5.2 specification: [//www.w3.org/TR/html5/fullindex.html#index-elements elements] | [//www.w3.org/TR/html5/fullindex.html#attributes-table attributes]
 
{{Help navigation}}
{{Wikipedia technical help|collapsed}}
 
[[Category:Wikipedia editor help]]