کؤمک:ویکی‌متنده اچ‌تی‌ام‌ال

(کؤمک:HTML in wikitext-دن يوْل‌لاندیریلمیش)


ویکی‌پدیانی ایداره ائدن مدیاویکی پروقرامی تقدیماتین فورمتلاشدیریلماسی اۆچون اچ‌تی‌ام‌ال ۵ المنتلرینین آلت چوْخلوغوندان و یا تقلردن و اوْنلارین صیفتلریندن ایستیفاده ائتمه‌یه ایمکان وئریر.[۱] لاکین اکثر اچ‌تی‌ام‌ال موعادیللری ویکی ایشاره‌له‌مه و یا شابلونلاریندان ایستیفاده ائتمکله داخیل ائدیله بیلر؛ بونلارا مقاله‌لر داخیلینده اۆستونلوک وئریلیر، چۆنکی بعضا اکثر دییشدیریجیلر اۆچون داها ساده اوْلور و دییشدیرمه پنجره‌سینده داها آز مۆداخیله ائدیر؛ but Wikipedia's Manual of Style recommends their use in certain cases. (See کؤمک:ویکی‌لشدیرمه for wiki equivalents to HTML tags not otherwise discussed below.) And HTML is useful outside of articles, for example for formatting within templates. For help with Cascading Style Sheet use within Wikipedia see Help:Cascading Style Sheets.

Some tags look like HTML, but are actually MediaWiki parser and extension tags, and so are really wiki markup. HTML in pages can be checked for HTML5 compliance by using validation. Some elements and attributes are supported by MediaWiki and browsers, but have been deprecated by HTML 5, and therefore should no longer be used.

درسلیکلر

دَییشدیر

This help page gives only an overview of allowed markup. For further assistance and detailed specifications:

صیفتلر

دَییشدیر

HTML attributes provide additional information about an element and are always specified in the start tag. They are formatted as a name/value pair like name="value".

Global attributes apply to all tags. Attributes not listed here are not allowed by MediaWiki[۱]:

  • class: one or more classifications to which the element belongs. See Wikipedia:Catalogue of CSS classes.
  • dir: text direction— "ltr" (left-to-right), "rtl" (right-to-left) or "auto".
  • id: unique identifier for the element.
  • lang: primary language for the contents of the element per BCP 47.
  • style: applies CSS styling to the contents of the element.
  • title: advisory information associated with the element.

HTML5 microdata attributes apply to all tags:[۲]

  • Any attribute beginning with data-
  • itemid
  • itemprop
  • itemref
  • itemscope
  • itemtype

Other tags such as <table> support specific attributes – these are listed in the appropriate section.

ایشاره‌له‌مه گؤستریر
This is <span style="color:red;">red</span> text.

This is red text.

The MediaWiki شابلون:Sanitizer.php does some cleanup on attributes. A best practice is to use the proper syntax.

  • Discards attributes not on a whitelist for the given element.
  • Turns broken or invalid entities into plaintext.
  • Double-quotes all attribute values.
  • Attributes without values are given the name as value.
  • Double attributes are discarded.
  • Unsafe style attributes are discarded.
  • Prepends space if there are attributes.

المنتلر

دَییشدیر

These HTML elements are supported by the MediaWiki software. This section gives a brief overview of the HTML element, an example, relevant wikimarkup and templates.

اچ۱، اچ۲، اچ۳، اچ۴، اچ۵، اچ۶

دَییشدیر

The <h1>...</h1> through <h6>...</h6> tags are headings for the sections with which they are associated. <h1> is used for the article title. Headings are styled through CSS and added to the page's table of contents.

ایشاره‌له‌مه گؤستریر
<h1>باشلیق ۱</h1>
<h2>باشلیق ۲</h2>
<h3>باشلیق ۳</h3>
<h4>باشلیق ۴</h4>
<h5>باشلیق ۵</h5>
<h6>باشلیق ۶</h6>
باشلیق ۱
باشلیق ۲
باشلیق ۳
باشلیق ۴
باشلیق ۵
باشلیق ۶

Wikimarkup: surround the text with the appropriate number of equal signs. Headers formatted with wikimarkup add an [edit] link.

ایشاره‌له‌مه گؤستریر
= باشلیق ۱ =
== باشلیق ۲ ==
=== باشلیق ۳ ===
==== باشلیق ۴ ====
===== باشلیق ۵ =====
====== باشلیق ۶ ======
باشلیق ۱
باشلیق ۲
باشلیق ۳
باشلیق ۴
باشلیق ۵
باشلیق ۶


شابلونلار: {{fake heading}} for use in documentation

<p>...</p> tag places content into a separate paragraph.

ایشاره‌له‌مه گؤستریر
<p>HyperText Markup Language</p><p>HyperText Markup Language</p>

HyperText Markup Language

HyperText Markup Language

Wikimarkup: Separate paragraphs by a single blank line.

ایشاره‌له‌مه گؤستریر
HyperText Markup Language

HyperText Markup Language

HyperText Markup Language

HyperText Markup Language

<p>...</p> is especially useful in lists, for list items with multiple paragraphs:

ایشاره‌له‌مه گؤستریر
* <p>This is a paragraph.</p><p>This is another paragraph in the same item.</p>
* This is a different item.
  • This is a paragraph.

    This is another paragraph in the same item.

  • This is a different item.

Note that the closing tag </p> is not strictly necessary for MediaWiki installations that output HTML 5 (such as Wikipedia).

<br> or <br /> inserts a line break. Both versions of the break are supported by HTML5. Using <br> without the / breaks syntax highlighting, so should be avoided. </br> is invalid.

ایشاره‌له‌مه گؤستریر
HyperText<br />Markup Language

HyperText
Markup Language

Templates:

  • {{break}} adds multiple line breaks.
  • {{crlf2}} adds a true carriage return and line feed.
  • {{clear}} adds a break with styling to clear floating elements.
  • {{plainlist}} creates an unbulleted list.

<hr> or <hr /> represents a paragraph-level thematic break and presents as a horizontal rule.

ایشاره‌له‌مه گؤستریر
<hr />

Wikimarkup: use ----

ایشاره‌له‌مه گؤستریر
----


Templates: {{hr}}

<!--...--> formats the enclosed text as a hidden comment.

ایشاره‌له‌مه گؤستریر
HyperText<!--Markup Language-->

HyperText

Be careful with spacing around comments. Surrounding a comment with blank lines will result in a blank paragraph, perceived as an extra two blank lines:

ایشاره‌له‌مه گؤستریر
Content line 1

<!-- Comment -->

Content line 2

Content line 1


Content line 2

<abbr>...</abbr> creates a tooltip to define an abbreviation or acronym that is displayed on mouse-over.

ایشاره‌له‌مه گؤستریر
<abbr title="HyperText Markup Language">HTML</abbr>

HTML

Templates: {{abbr}}

<b>...</b> formats text stylistically offset from other text (bold) without conveying extra importance.

ایشاره‌له‌مه گؤستریر
<b>HyperText Markup Language</b>

HyperText Markup Language

Wikimarkup: Use ''' to open and close bold text.

ایشاره‌له‌مه گؤستریر
'''HyperText Markup Language'''

HyperText Markup Language

<bdi>...</bdi> isolates the content from the surrounding text-direction settings.

ایشاره‌له‌مه گؤستریر
اليمين إلى اليسارleft to right

اليمين إلى اليسارleft to right

اليمين إلى اليسار<bdi>left to right</bdi>

اليمين إلى اليسارleft to right

Support: Firefox, Chrome

<bdo>...</bdo> specifies the text direction.

Attributes and values:

  • dir – Specifies the text direction.
    • ltr
    • rtl
ایشاره‌له‌مه گؤستریر
<bdo dir="rtl">HyperText Markup Language</bdo>

HyperText Markup Language

<blockquote>...</blockquote> presents text in an offset block.

ایشاره‌له‌مه گؤستریر
<blockquote>HyperText Markup Language</blockquote>

HyperText Markup Language

Templates: {{quote}}; supports pre-formatted attribution and source parameters. For other specialized quotation templates, see Category:Quotation templates.

<cite>...</cite> contains the title of a work. This is a new definition in HTML5— in the previous XML implementation <cite> was used to contain a citation or a reference to other sources. No formatting is applied when this tag is used.

ایشاره‌له‌مه گؤستریر
<cite>HyperText Markup Language</cite>

HyperText Markup Language

<cite>...</cite> is generally not used directly in Wikipedia articles, and is often misused; see Wikipedia:HTML 5#cite for replacement instructions.

<code>...</code> formats a section of computer code. Styled with CSS through شابلون:MediaWiki source as a monospaced typeface with a grey background and border.

ایشاره‌له‌مه گؤستریر
<code>HyperText Markup Language</code>

HyperText Markup Language

Templates: {{code}} uses <syntaxhighlight>. See the "See also" section at the template page for additional code-markup templates.

See § samp and § kbd on this page for semantic markup of output and input, respectively.

<data>...</data> formats a machine-readable version of contents.

ایشاره‌له‌مه گؤستریر
<data value="978-0764502149">HTML for Dummies</data>

HTML for Dummies

Attributes: value

<del>...</del> formats deleted text.

ایشاره‌له‌مه گؤستریر
<del>HyperText Markup Language</del>

HyperText Markup Language

<dfn>...</dfn> is used for indicating the defining instance of a term.

ایشاره‌له‌مه گؤستریر
<dfn>Definition</dfn>

Definition

Templates: {{dfn}}

<em>...</em> represents a span of text with emphatic stress (i.e. semantic emphasis). In most browsers, it renders as italic.

ایشاره‌له‌مه گؤستریر
<em>HyperText Markup Language</em>

HyperText Markup Language

Templates: {{em}}

<i>...</i> represents a span of text offset from its surrounding content without conveying any extra emphasis or importance, and for which the conventional typographic presentation is italic text.

ایشاره‌له‌مه گؤستریر
<i>HyperText Markup Language</i>

HyperText Markup Language

Wikimarkup: Use '' to open and close italic text.

ایشاره‌له‌مه گؤستریر
''HyperText Markup Language''

HyperText Markup Language

<ins>...</ins> indicates a range of text that has been added. Styled as underlined text. Used on talk pages to indicate refactored text; see ویکی‌پدیا:دانیشیق صفحه‌سی.

ایشاره‌له‌مه گؤستریر
<ins>HyperText Markup Language</ins>

HyperText Markup Language

<kbd>...</kbd> indicates user input such as keyboard input or voice commands.

ایشاره‌له‌مه گؤستریر
Press <kbd>Enter</kbd>

Press Enter

Templates:

  • {{kbd}} applies monospace styling, and a light-grey background to distinguish from code (<code>) and output (<samp> or {{samp}}).
  • {{key press}} renders illustrated keys and keystrokes.

<mark>...</mark> represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context. Marked text is formatted with a yellow background by default.

ایشاره‌له‌مه گؤستریر
<mark>HyperText Markup Language</mark>

HyperText Markup Language

<mark style="background:lightblue;">HyperText Markup Language</mark>

HyperText Markup Language

Support: Not supported by Internet Explorer 8 and below.

<pre>...</pre> element represents a block of preformatted text. In MediaWiki, <pre> is actually a parser tag and not HTML, but the function is the same. It also prevents the parsing of templates.

ایشاره‌له‌مه گؤستریر
<pre>HyperText Markup Language</pre>
HyperText Markup Language
HTML entities
دَییشدیر

<pre> parses HTML entities. If you want to escape this, replace & with &amp;, or use <syntaxhighlight lang="text"> instead.

ایشاره‌له‌مه گؤستریر
<pre>&amp;</pre>
&
<pre>&lt;</pre>
<
<pre>&amp;amp;</pre>
&amp;
<pre>&amp;lt;</pre>
&lt;

Templates:

  • {{pre}} wraps text that overflows the page.

<q>...</q> is used to mark a short quotation. There has been very little implementation of this element in Wikipedia yet.

ایشاره‌له‌مه گؤستریر
<q>HyperText Markup Language</q>

HyperText Markup Language

ویکی‌پدیا:یؤندملیک says Wikipedia should instead use "", {{quote}}, or <blockquote>.

rp, rt, ruby

دَییشدیر

<ruby>...</ruby> marks spans of phrasing content with ruby annotations.

  • <rt>...</rt> marks the ruby text component of a ruby annotation; the ruby text shows in a reduced size over top of the normal characters.
  • <rp>...</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.

ایشاره‌له‌مه گؤستریر
<ruby><rp>(</rp><rt>とう</rt><rp>)</rp><rp>(</rp><rt>きょう</rt><rp>)</rp>
</ruby>

(とう)(きょう)

Templates:

<s>...</s> is used to indicate content that is no longer accurate or relevant and that has been struck from the page. It is not appropriate when indicating document edits; to mark a span of text as having been removed from a document, use <del>.

ایشاره‌له‌مه گؤستریر
<s>HyperText Markup Language</s>

HyperText Markup Language

Templates: {{strikethrough}}

<samp>...</samp> indicates sample output from a program or computing system. Examples include: output of a program, script, or Wikipedia template; status displays or audio announcements made by an app or device; file system directory listings and samples from them, such as paths and file names.

ایشاره‌له‌مه گؤستریر
<samp>HyperText Markup Language</samp>

HyperText Markup Language

Templates: {{samp}} applies monospace styling, and gives the text in dark grey to distinguish from code (<code>) and input (<kbd> or {{kbd}}).

<small>...</small> format small text.

ایشاره‌له‌مه گؤستریر
<small>HyperText Markup Language</small>

HyperText Markup Language

Templates:

  • {{small}} uses <span style="font-size:85%;">. {{small}} is recommended over <small> since <small>...</small> has a semantic meaning that is for fine print, whereas {{small}} is purely stylistic.

<strong>...</strong> formats a span of text with strong importance or unusual emphasis; in most browsers it renders as boldface. This should generally not be used in Wikipedia articles, per ویکی‌پدیا:طرف‌سیزلیک policy. See on use of this element and other boldfacing. Most semantic emphasis, including in quoted material, should be rendered with the <em> element.

ایشاره‌له‌مه گؤستریر
<strong>HyperText Markup Language</strong>

HyperText Markup Language

Templates: {{strong}}

<sub>...</sub> formats a span of text as a subscript.

ایشاره‌له‌مه گؤستریر
HyperText <sub>Markup Language</sub>

HyperText Markup Language

Templates:

<sup>...</sup> formats a span of text as a superscript.

ایشاره‌له‌مه گؤستریر
HyperText <sup>Markup Language</sup>

HyperText Markup Language

Templates:

<time>...</time> defines either a time (24 hour clock), or a date in the Gregorian calendar, optionally with a time and a time-zone offset.

ایشاره‌له‌مه گؤستریر
<time>10:00</time>

Attributes: datetime

Support: Not supported by Internet Explorer 8 and below.

<u>...</u> represents a span of text offset from its surrounding content without conveying any extra emphasis or importance, and for which the conventional typographic presentation is underlining; for example, a span of text in Chinese that is a proper name (a Chinese proper name mark), or span of text that is known to be misspelled.

<u> was presentational element of HTML that was originally used to underline text; this usage was deprecated in HTML4 in favor of the CSS style {text-decoration: underline}.[۳] In HTML5, the tag reappeared but its meaning was changed significantly: it now "represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation".[۳] This facility is intended for example to provide a red wavy line underline to flag spelling errors at input time but which are not to be embedded in any stored file (unlike an emphasis mark, which would be).

ایشاره‌له‌مه گؤستریر
<u>HyperText Markup Language</u>

HyperText Markup Language

Templates: {{underline}} (which supplies the recommended CSS style)

<var>...</var> formats text in italics to indicate a variable in a mathematical expression or programming context, or placeholder text that the reader is meant to mentally replace with some other literal value.

ایشاره‌له‌مه گؤستریر
*<var>E</var>=<var>m</var>c<sup>2</sup> (c is a constant not a variable)
*<code><nowiki>{{</nowiki><var>TemplateName</var>|<var>parameter</var>=<var>value</var><nowiki>}}</nowiki></code>
*If <var>A</var> then <var>B</var>
  • E=mc2 (c is a constant not a variable)
  • {{TemplateName|parameter=value}}
  • If A then B

Templates:

  • {{var}}
  • {{varserif}} formatted in italic serif to differentiate characters

<wbr> 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.

ایشاره‌له‌مه گؤستریر
Now is the time to become a power editor, by learning HyperText Markup Language

Now is the time to become a power editor, by learning HyperText Markup Language

Now is the time to become a power editor, by learning Hyper<wbr>Text Markup Language

Now is the time to become a power editor, by learning HyperText Markup Language

As the browser window is adjusted narrower, the second example wraps between Hyper and Text.

Do not leave blank lines between items in a list unless there is a reason to do so, since this causes the MediaWiki software to interpret each item as beginning a new list.

<dl>...</dl>, <dt>...</dt> and <dd>...</dd> are used to create a description list (formerly definition list) with terms and descriptions. Terms are displayed in bold and descriptions are indented. Each term must include one or more descriptions.

ایشاره‌له‌مه گؤستریر
<dl>
<dt>Term</dt>
<dd>Definition 1</dd>
<dd>Definition 2</dd>
</dl>
Term
Definition 1
Definition 2

Wikimarkup: <dt> is created using ; while automatically enclosed in <dl>...</dl>. <dd> is created using : for each value. For a single or first value the : can be placed on the same line after ; where subsequent values must be placed on separate lines.

ایشاره‌له‌مه گؤستریر
; Term
: Definition 1
: Definition 2
Term
Definition 1
Definition 2

Templates: {{defn}}

<ol>...</ol> represents an ordered list; <ul>...</ul> represents an unordered list; <li>...</li> represents a list item within either type of list.

ایشاره‌له‌مه گؤستریر
<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>
  1. Item 1
  2. Item 2
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
  • Item 1
  • Item 2

Wikimarkup: use * for items in an unordered list and # for ordered lists.

ایشاره‌له‌مه گؤستریر
# Item 1
# Item 2

  1. Item 1
  2. Item 2
* Item 1
* Item 2

  • Item 1
  • Item 2

Templates: for a variety of specialized uses, see Category:List formatting and function templates.

<div>...</div> is a generic container for flow content that displays as a block element.

ایشاره‌له‌مه گؤستریر
HyperText <div>Markup</div> Language
HyperText
Markup
Language

<span>...</span> is a container for flow content that displays as an inline element.

ایشاره‌له‌مه گؤستریر
HyperText <span>Markup</span> Language

HyperText Markup Language

table, td, tr

دَییشدیر

<table>...</table> defines a table.

  • <tr>...</tr> defines a table row.
  • <td>...</td> defines a data cell with contents that may include text, links, images, lists, forms, other tables, etc.
ایشاره‌له‌مه گؤستریر
<table border=1>
<tr>
<td>data</td>
<td>data</td>
</tr>
</table>
data data

Attributes:

  • <table>:
    Allowed but not recommended: border="" and border="1"
    Allowed but obsolete: border (with a non-empty value different from "1"), align, bgcolor, cellpadding, cellspacing, frame, rules, summary, width[۴]
  • <td>: colspan, headers, rowspan
    Allowed but obsolete: abbr, align, axis, bgcolor, scope, height, nowrap, valign, width[۴]

<th>...</th> defines a table header; styled as centered and bold.

ایشاره‌له‌مه گؤستریر
<table border="1">
<tr>
<th>Header</th>
<th>Header</th>
</tr>
<tr>
<td>data</td>
<td>data</td>
</tr>
</table>
Header Header
data data

Attributes:

  • <th>: colspan, headers, rowspan, scope
    Allowed but obsolete: abbr, align, axis, bgcolor, height, nowrap, valign, width[۴]

<caption>...</caption> adds a caption to a table.

ایشاره‌له‌مه گؤستریر
<table border=1>
<caption>Caption</caption>
<tr>
<td>data</td>
<td>data</td>
</tr>
</table>
Caption
data data

Attributes:

  • <caption>:
    Allowed but obsolete: align[۴]

thead, tfoot, tbody

دَییشدیر

<thead>, <tfoot> and <tbody> are not supported, but are automatically generated when the page is rendered.

Obsolete/deprecated elements

دَییشدیر

These elements are now obsolete and either deprecated or removed in HTML5, but still supported by browsers.[۴] These tags either have an alternate tag or a template that replaces their function with CSS. See Wikipedia:HTML5 § Obsolete elements and attributes for more details on obsolete HTML parts and their replacements.

<center>...</center> (obsolete) is used to center text elements.

Templates: {{center}} uses CSS.

<font>...</font> (obsolete) is used to set the font size, font face and color of text.

Templates: {{font}} uses CSS.

<rb>...</rb> (obsolete) Used to mark base text in a ruby annotation

For replacements, see: Help:HTML in wikitext#rp, rt, ruby

<strike>...</strike> (obsolete) formats strike-through characters; use <s> instead.

<tt>...</tt> (obsolete) formats text in a fixed-width font. Use <code>, <kbd> or <samp> instead.

Templates: {{mono}} uses CSS.

Unsupported elements

دَییشدیر

These elements are not supported, but have equivalent wiki markup. Attempting to use any element not whitelisted by شابلون:Sanitizer.php will result in the markup showing as plain text.

<a> is used to create links. Use the [[ ]] wikimarkup for internal/intrawiki links and interwiki links, and [ ] for external links.

<input> is used to create forms. The <inputbox> extension tag is used to create a text box with a button.

HTML Tidy is an outdated HTML4 library that is 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, <br>, </br>, <br/>, <br.> all rendered as <br />. Tidy is not enabled for MediaWiki interface pages. Tidy was never perfect and has been known to introduce errors.

In some pages in the MediaWiki namespace, typically the short messages like button labels, HTML is not parsed, and tags will be exposed.

User and sitewide CSS and جاوااسکریپت pages are interpreted as if inside a <pre> block. See Help:User style.

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 W3C Markup Validation Service.

Parser and extension tags

دَییشدیر

شابلون:Xtag/doc

همچینین باخ

دَییشدیر

قایناقلار

دَییشدیر

ائشیک باغلانتیلار

دَییشدیر