Template:Center or HI
Usage
[edit]This template uses block elements, e.g. See H:DIVSPAN for details. |
This template creates a heading that is centred if it is short and fits on a single line, or left aligned with a hanging indent if it's longer and spans multiple lines. This is a common formatting method in some works with a mixture of short and long chapter titles or descriptions.
You can specify an indent by adding a width as the first parameter (just like {{hanging indent}}). For a non-hanging indent, set indent to yes
.
- Simple usage
{{Center or HI|Short Heading text}}
Short Heading text
{{Center or HI|Long heading: {{lorem ipsum}}}}
Long heading: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- Specify the hanging indent by putting the indent width first
{{Center or HI|8em|{{lorem ipsum}}}}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
- Normal (non-hanging indent)
{{Center or HI|indent=yes|8em|{{lorem ipsum}}}}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
See also
[edit]- {{hanging indent}} for hanging indents that are not centred when short