Paragraph spacing

From Meta, a Wikimedia project coordination wiki
Jump to navigation Jump to search

Many people find the standard paragraph spacing too tight on the "monobook" skin of Mediawiki. While most Wiki articles use titles and bulleted lists profusively, monobook's paragraph spacing is about .5em and can make long blocks of text very difficult to read. The solution proposed here can also work in other skins including vector skin.

But how do you make such layout or display changes to MediaWiki? Layout options like this are NOT part of MediaWiki's preferences. Instead, you can adjust them by tweaking the cascading stylesheet for the particular skin you are using with your MediaWiki installation or project.

So, the short answer to this problem is: It isn't a MediaWiki problem. Go learn about stylesheets and make your own skin!

Changing paragraph spacing[edit]

But here's a rough procedure that should get you started:

  1. Figure out what Wiki skin you are currently using. Is it monobook? Probably. Check your preferences.
  2. Go to the appropriate directory of your Mediawiki project. For instance: User:<user name>/common.css
  3. Edit the common.css file. I use vi, but any text editor should be fine. You may need to set permissions or be an administrative user... talk to your sysadmin!
  4. Insert a comment and any standard css code to adjust the relevant part of your document.

For that last step, I inserted this:

/* Douglas attempts to add more space between paragraphs */
p {margin-bottom: 1em}

The first line is a comment.

The second line modifies p, or paragraphs, setting the "margin-bottom" element to "1em". If you are familiar with typography, you understand what 1em means. You could also write .6cm (centimeters) or use a percentage. Basically, I am setting the stylesheet so all pages that are rendered using it (including all Wiki pages seen through the monobook skin) should put a 1em margin on the bottom of each paragraph.

Wherever you place CSS lines, pay attention to the syntax and be careful not to place them in the middle of some other CSS line.