Template:Boxcode: Difference between revisions

From PS3 Developer wiki
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|width=50%|float=left|title=width=50% float=left|code=<syntaxhighlight lang="xml">
{{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 at bottom of the template to preserve the width of the wiki pages
very long lines adds a horizontal scroll bar
</syntaxhighlight>}}
</syntaxhighlight>}}
{{Boxcode|width=50%|float=right|title=width=50% float=right|code=<syntaxhighlight lang="xml">
{{Boxcode|float=right|title=float=right|code=<syntaxhighlight lang="xml">
<code>
<code>
lines
lines
<!--here-->
<!--here-->
very long lines adds a horizontal scroll bar at bottom of the template to preserve the width of the wiki pages
very long lines adds a horizontal scroll bar
</syntaxhighlight>}}
</syntaxhighlight>}}


{{clear}}
{{clear}}


{{Boxcode|width=700px|float=left|title=width=700px float=left|code=<syntaxhighlight lang="xml">
{{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|width=auto|float=right|title=width=auto float=right|code=<syntaxhighlight lang="xml">
{{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|width=auto|float=right|title=width=auto float=right|code=<syntaxhighlight lang="xml">
 
{{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|title=width=350px height=200px float=right|code=<syntaxhighlight lang="xml">
{{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|width=auto|height=auto|float=left|title=width=auto height=auto float=left|code=<syntaxhighlight lang="xml">
 
{{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|height=auto|float=left|title=width=150px height=auto float=left|code=<syntaxhighlight lang="xml">
{{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
Edit-copy purple.svg.png
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
Edit-copy purple.svg.png
<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
Edit-copy purple.svg.png
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=right
Edit-copy purple.svg.png
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=left, width=50%
Edit-copy purple.svg.png
<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%
Edit-copy purple.svg.png
<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
Edit-copy purple.svg.png
<code>
lines
<!--here-->
very long lines adds a horizontal scroll bar
float=right, width=350px, height=200px
Edit-copy purple.svg.png
<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)
Edit-copy purple.svg.png
<code>
lines
<!--here-->
float=left, width=150px (with a title longer than the code but restricted in width)
Edit-copy purple.svg.png
<code>
lines
<!--here-->