Jump to content

Help:Useful styles

From Wikipedia, the free encyclopedia

This page documents various CSS elements that are useful to know when working in the article and template namespaces. For information about how to use them, see:

Classes[edit]

Specific styles[edit]

  • border-collapse:collapseThis style will eliminate 3-d style borders created by theborderattribute and collapse them in 1px wide borders.This property will overridecellspacing!To define similar whitespace, use theborder-spacingproperty (although it is not possible to have bothborder-spacingandborder-collapsefor the same table).

Moving stuff[edit]

  • float:rightandclear:rightThese styles are used to move a table to the right-hand side of the screen. Float right is equivalent toalign= "right"Theclearcode property makes it impossible for the movement to be blocked by another box or picture: the template will automatically move under it.

Margins and sizes[edit]

  • margin:0 0 0.5em 1em;This style prevents text from running straight to the template by saving blank space. It should be used on boxes which are floated right (usingfloat: right;).
    • margin:0 1em 0.5em 0;This performs the same function as the style directly above, but should be used for boxes which are floated left (usingfloat: left;).

See also[edit]