Template:Boxcode: Difference between revisions
Jump to navigation
Jump to search
m (Removed the "margin" hack. It was intended to prevent line wrapping but now the "white-space:pre" is applyed globally to <pre> and <syntaxhighlight> tags since 2021/09/09) |
m (Better examples... finally the scrollbars are working great and there are no line wrappings) |
||
Line 34: | Line 34: | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode | {{clear}} | ||
{{Boxcode|float=left|title=float=left|code=<syntaxhighlight lang="xml"> | |||
<code> | <code> | ||
lines | lines | ||
<!--here--> | <!--here--> | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode | {{Boxcode|float=right|title=float=right|code=<syntaxhighlight lang="xml"> | ||
<code> | <code> | ||
lines | lines | ||
<!--here--> | <!--here--> | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{clear}} | {{clear}} | ||
{{Boxcode| | {{Boxcode|float=left|width=50%|title=float=left, width=50%|code=<syntaxhighlight lang="xml"> | ||
<code> | <code> | ||
lines | lines | ||
<!--here--> | <!--here--> | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode| | {{Boxcode|float=right|width=50%|title=float=right, width=50%|code=<syntaxhighlight lang="xml"> | ||
<code> | <code> | ||
lines | lines | ||
<!--here--> | <!--here--> | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode| | |||
{{clear}} | |||
{{Boxcode|float=left|width=700px|title=float=left, width=700px|code=<syntaxhighlight lang="xml"> | |||
<code> | <code> | ||
lines | lines | ||
Line 67: | Line 72: | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode|width=350px|height=200px|float=right | {{Boxcode|float=right|width=350px|height=200px|title=float=right, width=350px, height=200px|code=<syntaxhighlight lang="xml"> | ||
<code> | <code> | ||
lines | lines | ||
Line 81: | Line 86: | ||
very long lines adds a horizontal scroll bar | very long lines adds a horizontal scroll bar | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode | |||
{{clear}} | |||
{{Boxcode|float=left|title=float=left (with a title longer than the code)|code=<syntaxhighlight lang="xml"> | |||
<code> | <code> | ||
lines | lines | ||
<!--here--> | <!--here--> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Boxcode|width=150px| | {{Boxcode|float=left|width=150px|title=float=left, width=150px (with a title longer than the code but restricted in width)|code=<syntaxhighlight lang="xml"> | ||
<code> | <code> | ||
lines | lines |
Revision as of 09:54, 9 September 2021
Code Sample
code
Usage
All the parameters in bold are optional, for a good look the "code sample" should start with either a <pre> or a <syntaxhighlight>
{{Boxcode|code=Code Sample}}
...or...
{{Boxcode|title=Custom Title|code=Code Sample}}
...or...
{{Boxcode|float=left|title=Custom Title|code=Code Sample}}
...or...
{{Boxcode|float=left|width=50%|title=Custom Title|code=Code Sample}}
...or...
{{Boxcode|float=right|width=50%|height=500px|title=Custom Title|code=Code Sample}}
Examples
Custom Title
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages
................................. ........................... ............................................ ....................................... ....................................................... ..................................... ....................... .............................o/sup
float=left
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=right
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=left, width=50%
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages
float=right, width=50%
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages
float=left, width=700px
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=right, width=350px, height=200px
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=left (with a title longer than the code)
<code>
lines
<!--here-->
float=left, width=150px (with a title longer than the code but restricted in width)
<code>
lines
<!--here-->