模板:Tag
外观
<tag>...</tag>
模板介绍
本模板可以用代码格式显示XML形式的标签,主要用于讨论页及帮助页面。
使用方法
|1=(必需):HTML标签名称|2=:标签的显示方式p、pair:(预设)显示相互对应的开、关标签,如<font>...</font>- 要隐藏标签之间的省略号的话,可加入置空的
|content=参数
- 要隐藏标签之间的省略号的话,可加入置空的
o、open、开、左:只显示开标签,如<span>c、close、关、右:只显示关标签,如</span>s、single:显示单项标签,如<br />
|content=、|3=、|内容=、|文字=:标签之间的内容|params=、|4=、|参数=:任何置于开标签内的参数
范例
{{tag|ref}}→<ref>...</ref>{{tag|ref|content=}}→<ref></ref>{{tag|ref|content=hello}}→<ref>hello</ref>{{tag|font|content=foo}}→<font>foo</font>{{tag|font|open}}→<font>{{tag|font|open|content=hello}}→<font>hello{{tag|span|close|content=hello}}→hello</span>{{tag|span|pair|content=hello}}→<span>hello</span>{{tag|ref|open|params=group="note"}}→<ref group="note">{{tag|references|single}}→<references />{{tag|br|single}}→<br />
注意事项
参见
- {{HTMLElement}}
- {{XMLElement}}
- {{xtag}}可显示MediaWiki解析器或扩展标签,并连结至该扩展的说明页面
- #tag:解析器函数可显示实际生效的标签