Help:Useful styles: Difference between revisions
Appearance
Content deleted Content added
m →CSS classes: +link |
→See also: microformats |
||
Line 24: | Line 24: | ||
==See also== |
==See also== |
||
*[[Wikipedia:Catalogue of CSS classes]] |
*[[Wikipedia:Catalogue of CSS classes]] |
||
*[[Wikipedia:WikiProject Microformats/classes|classes used in microformats]] |
|||
<!--Categories--> |
<!--Categories--> |
Revision as of 20:57, 22 August 2008
This help page needs to be updated. Please help update this help page to reflect recent events or newly available information. Relevant discussion may be found on the talk page. |
‹The template How-to is being considered for merging.›
This article contains instructions, advice, or how-to content. |
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:
CSS classes
- wikitable This class represents Wikipedia's favored style for data tables.
- toccolours This class gives the template borders and colors similar to that of the Table of Contents of a page. Do not use
id="toc"
instead of this, as it risks breaking some scripts.toccolours
is not used much anymore, but used to be used for footer templates etc. - navbox This class is used on most footer templates (e.g. {{Regions of the world}}). See also Template:Navbox.
- infobox This class is used for infoboxes (e.g. {{Infobox Settlement}}).
- ambox (ambox-image, ambox-notice…) These classes are used to style templates affected by Wikipedia:Article message boxes.
- messagebox standard-talk This class combination is used to style templates affected by Wikipedia:Talk page templates.
Specific styles
- border-collapse:collapse This style will eliminate 3-d style borders created by the
border
attribute and collapse them in 1px wide borders. This property will overridecellspacing
! To define similar whitespace, use theborder-spacing
property (although it is not possible to have bothborder-spacing
andborder-collapse
for the same table).
Moving stuff
- float:right and clear:right These styles are used to move a table to the right-hand side of the screen. Float right is equivalent to
align="right"
Theclear
code 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
- 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 (using float: 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 (using float: left;).
See also