Template:Tag/doc#Examples
{{Documentation subpage}}
{{high-use}}
{{About|'displaying' markup tags|'using' markup tags|mw:Help:Magic_words#Miscellaneous{{!}}the #tag magic word|the inline maintenance tag|Template:Fix}}
: {{tc|tag|tagname [|type] [|content=text] [|attribs=attributes and values]}}
A markup tag is an open < and a close > angle brackets and the content within them, in a markup language, as XML or HTML:
:For example, the
This template provides a quick way to mention a markup-style tag in a preformatted way. Mainly used in discussion/help pages.
Parameters
{{See also|Span and div}}
Required parameters shown in bold italics.
; {{para|1}} {{nobold| (tagname above)}} : The XML/HTML tag's name (e.g. {{mono|100%|code}}, {{mono|100%|ref}}).
; {{para|2}} {{nobold| (type above)}} : To indicate which of the tag's types is/are presented:
:; p
(pair
) (default) : A matching pair of open/start and close/end tags (e.g. {{tag|div|pair}}).
To suppress the ellipsis ("...") between the tags, add an empty {{para|content}} parameter (for example, {{tag|div|pair|content=}}).
:; o
(open
) : An open/start tag (e.g. {{tag|span|open}}).
:; c
(close
) : A close/end tag (e.g. {{tag|span|close}}).
:; e
(empty
) or s
(single
) or v
(void
) : An empty element, formed with a single self-terminating tag (e.g. {{tag|hr|single}}); in HTML5 these are now known as "void" elements, though "empty" is the more common term.
; {{para|content}} : Text to place between open/start and close/end tags.
; {{para|attribs}} : Attributes and values to be included as part of an open/start tag (this parameter can also be called {{para|params}}).
; {{para|wrap|yes}} : Disable nowrap for long samples, so allowing wraps (line breaks).
; {{para|link|yes}} : Link to the element's entry in the HTML element article, For example: {{tnull|Tag|del|link{{=}}y}} produces: {{Tag|del|link=y}}. This is {{em|only}} for HTML elements; the page for the link is hard-coded.
; {{para|style}} : Replace the default CSS style (border:none; background:transparent). For example: {{para|style|background: cornsilk}}
Examples
{{Markup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|attribs=href="<nowiki>https://en.wikipedia.org/</nowiki>"
|content=English Wikipedia}} | {{tag|a|attribs=href="
}}
Global use and documentation
For a global use of this template in other sister or Wikimedia projects, after copying it to paste in the destination project, remember to change in the code:
|p|pair = <{{#if:{{{link|}}}|[[HTML element#
by this one:
|p|pair = <{{#if:{{{link|}}}|[[Wikipedia:en:HTML element#
Remark that the code Wikipedia:en:
has been added.
For template documentation in the sister project, you can use Template:Wikipedia doc.
See also
- HTML tag
- {{tl|HTMLElement}}
- {{tl|XMLElement}}
- {{tl|xtag}} adds a MediaWiki parser or extension tag that links to the extension page.
- #tag:, the parser function that generates working tags.
=Other formatting templates=
{{#lsth:Template:Template-linking_templates|Other formatting templates}}
{{semantic markup templates}}
Category:HTML typing-aid templates
Category:Wikitext typing-aid templates
}}