Template:SubHeading: Difference between revisions

Jump to navigation Jump to search
fuller documentation and adding alignment option
(some clarification in documentation.)
(fuller documentation and adding alignment option)
 
Line 1: Line 1:
<includeonly>{{br|{{{3|}}}}}<h3 style="border-bottom: none; font-size:large; font-weight:bold;">{{{1|}}}</h3><hr style="background:{{color|{{{2}}}}}; height:2px"></includeonly><noinclude>This template creates a sub heading style that uses a thin colored line specified by the user. It is an alternative to [[Template:Section]], [[Template:Heading]] and [[Template:Header]].
<includeonly>{{br|{{{3|}}}}}<h3 style="border-bottom: none; font-size:large; font-weight:bold;{{#if: {{{ALIGN|}}}|text-align:{{{ALIGN|}}}|}}">{{{1|}}}</h3><hr style="background:{{color|{{{2}}}}}; height:2px"></includeonly><noinclude>This template creates a subheading style that uses a thin colored line specified by the user. Basically, it creates a heading one level below [[Template:Heading]] when listed in the table of contents (the equivalent of h3 or <nowiki>===This level===</nowiki> compared to [[Template:Heading]], which is equivalent to h2 or <nowiki>==This Level==</nowiki>). For instance, notice in the table of contents that "How to Use" is a parent header to all the other headers in the table of contents. This is because it is using [[Template:Heading]].


===Note about colors===
===Note about colors===
This template translates the standard color names for the divisions to the colors we use on the wiki. Thus '''<font color=maroon>Red</font>, <font color=darkgoldenrod>Gold</font>, <font color=steelblue>Blue</font>, <font color=teal>Teal</font>, <font color=purple>Violet</font>, <font color=black>Black</font>, <font color=dimgray>Silver</font>, and <font color=darkgreen>Green</font>''' are not necessarily the same as their true html color name. Any other html color name or HEX code will be shown as entered. To get around the preset color names above, use the raw HEX code (for instance, use #FF0000 to get <font color=#FF0000>this red</font> rather than using "Red" to get <font color=maroon>this red</font>. [http://www.w3schools.com/html/html_colornames.asp Consult this table for reference.]
This template translates the standard color names for the divisions to the colors we use on the wiki. Thus '''<font color=maroon>Red</font>, <font color=darkgoldenrod>Gold</font>, <font color=steelblue>Blue</font>, <font color=teal>Teal</font>, <font color=purple>Violet</font>, <font color=black>Black</font>, <font color=dimgray>Silver</font>, and <font color=darkgreen>Green</font>''' are not necessarily the same as their true html color name. Any other html color name or HEX code will be shown as entered. To get around the preset color names above, use the raw HEX code (for instance, use #FF0000 to get <font color=#FF0000>this red</font> rather than using "Red" to get <font color=maroon>this red</font>. [http://www.w3schools.com/html/html_colornames.asp Consult this table for reference.]


===Example===
{{Heading|How to Use|black}}
<pre>{{SubHeading|Name of Heading|Blue}}</pre>
<pre>{{SubHeading|Name of Heading|Blue}}</pre>


{{SubHeading|Name of Heading|Blue}}
{{SubHeading|Name of Heading|Blue}}




===Clearing a Section===
===Clearing a Section===
You can also add a <br clear=all> before the heading so that a thumbnail or sidebar will be displayed completely above it by adding "clear" to the end :
You can also add a <nowiki><br clear=all></nowiki> before the heading so that a thumbnail or sidebar will be displayed completely above it by adding "clear" to the end :


<pre>{{SubHeading|Name of Heading|Color|clear}}</pre>
<pre>{{SubHeading|Name of Heading|Color|clear}}</pre>
Line 23: Line 21:
{{SubHeading|After|Gold|clear}}
{{SubHeading|After|Gold|clear}}


===Changing alignment of text===
You can now have the subheading text appear on the center or right by adding ALIGN=center or ALIGN=right.
<pre>{{SubHeading|USS Enterprise|Red|ALIGN=center}}</pre>
{{SubHeading|USS Enterprise|Red|ALIGN=center}}
<pre>{{SubHeading|Starfleet Medical|Teal|ALIGN=right}}</pre>
{{SubHeading|Starfleet Medical|Teal|ALIGN=right}}
[[Category:Templates]]
[[Category:Templates]]
__NOTOC__</noinclude>
</noinclude>

Navigation menu