• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Center block

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentation[view] [edit] [history] [purge]

This template places a block of text in the center of the page, without affecting the text alignment within that block.

Contents

  • 1 Usage
    • 1.1 Parameters
      • 1.1.1 Example 1
      • 1.1.2 Example 2
      • 1.1.3 Example 3
  • 2 TemplateData
  • 3 See also

Usage

Parameters

Where there is a requirement to fix the width or height of the block, optional "width" and "height" parameters can be used. If additional style adjustments are required, use the optional "style" parameter.

Example 1

{{center block|width=300px|height=200px|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br>
Aenean commodo ligula eget dolor.

Aenean massa.}}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.

Example 2

  • For exactly the same "spacing" as rendered by normal paragraph(s) before &/or after the template-inserted content.
<p>By clicking the “Save page” button, you are agreeing to the Terms of Use, the Privacy Policy, and you irrevocably agree to release your contribution under the CC-BY-SA 3.0 License and the GFDL. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.</p>

{{center block|width=300px|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br>
Aenean commodo ligula eget dolor.

Aenean massa.}}

<p>Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.</p>

By clicking the “Save page” button, you are agreeing to the Terms of Use, the Privacy Policy, and you irrevocably agree to release your contribution under the CC-BY-SA 3.0 License and the GFDL. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.

Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Example 3

  • For slightly larger "spacing" between normal paragraph(s) before &/or after the template-inserted content.
<p>By clicking the “Save page” button, you are agreeing to the Terms of Use, the Privacy Policy, and you irrevocably agree to release your contribution under the CC-BY-SA 3.0 License and the GFDL. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.</p>

{{center block|max-width=300px|Lorem ipsum dolor sit amet, consectetuer adipiscing elit.<br>
Aenean commodo ligula eget dolor.

Aenean massa.}}

<p>Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.</p>

By clicking the “Save page” button, you are agreeing to the Terms of Use, the Privacy Policy, and you irrevocably agree to release your contribution under the CC-BY-SA 3.0 License and the GFDL. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aenean commodo ligula eget dolor.

Aenean massa.

Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Center block in articles based on its TemplateData.

TemplateData for Center block

A template to center-align block with content in any other places, without affecting the text alignment within that block. This may harm some templates.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Content1

no description

Contentrequired
Width of block areawidth

no description

Unknownoptional
Maximum width of block areamax-width

no description

Unknownoptional
Height of block areaheight

no description

Unknownoptional
Horizontal alignment of the contentalign

no description

Unknownoptional
Titletitle

no description

Unknownoptional
Custom CSSstyle

no description

Unknownoptional

See also

  • {{center}}
  • {{align}}
The above documentation is transcluded from Template:Center block/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Center_block&oldid=1282629723"
Last edited on 27 March 2025, at 16:38

Languages

    • Farefare
    • Ladin
    • മലയാളം
    • Bahasa Melayu
    • Монгол
    • ਪੰਜਾਬੀ
    • සිංහල
    • Simple English
    • Slovenščina
    • Tagalog
    • தமிழ்
    • ไทย
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 27 March 2025, at 16:38 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop