Template:Inputbox

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search
Demo text on template page only. 
Template documentation[view] [edit] [history] [purge]

Usage[edit]

{{Inputbox}} will display a short line of text as if being the content of a basic input box. One use is to emulate the display of the edit summary box.

Code
{{Inputbox|/* Heading */ my summary}}
Gives 
/* Heading */ my summary

Notes[edit]

  • The box can be indented using standard prefixes such as ":", "*", or ":*".
  • The box uses the appearance set for Wikipedia's "messagebox" (monobook: black text on white background, 80% the width of the screen), with nowrap.
  • If you use a very long sentence, the text will continue to the right of the box and a horizontal scrollbar for the whole page appears. Can be changed with options.
  • As with other templates, you will need to use "1=" if your text includes an equal sign, or enclose all or part of your text in <NOWIKI>...</NOWIKI>.
  • Please do not subst: this template.

Options[edit]

Default values are usually inherited from class=messagebox.

overflow
How the text will overflow if longer than the box. Can be "hidden" (box keeps it width, end of text is hidden) or "scroll" (box gets an underside horizontal scrollbar, end of text is available). (Defaults to "visible", the box will become as wide as needed to display a long text.)
width
Width of the box, can be "50%", "20em", etc. (Defaults to "80%")
style
Allows any additional semicolon-separated CSS style in the format "name:value; name:value; etc." (Defaults to empty)

Examples[edit]

Code
{{Inputbox|width=20%|overflow=scroll|This is gonna be too large for me, ouch! ouch! ouch!}}
Gives 
This is gonna be too large for me, ouch! ouch! ouch!
Code 
{{Inputbox|style=background-color:yellow; color:red; width:40%;|My eyes! My eyes!}}
Gives
My eyes! My eyes!