|
Parallel Visions: City of Angels City of Demons ebook and trade paperback available on Amazon (or here). |
![]() |
|||
Template:Div
Contents
Not included[edit]
| Tags: | Template, Div Template, Layout Template, HTML Template, XHTML Template |
| Layout Template: | |
| Version: | |
| Version Transcluded: |
Documentation
Usage[edit]
This template is a "wrapper", making it faster and easier to use the [X]HTML <div>...</div> element, for those who prefer to write in wikicode than bare HTML tags. It supports all of the HTML element's features that would be useful on Wikipedia and accepts them as parameters. It is also used (and was initially created) to work around problems in templates and ParserFunctions caused by presence of XHTML or lack of WikiMarkup in particular code instances.
A div in Web coding terms is a generic block element of content, such as set of paragraphs, a section of a page with a frame around it, a right-floating sidebar, or some other discrete "chunk" of content that can be though of an independent object. It does not act as an inline span of text like, say, a phrase that needs to be in a green font. Rather it is a container for inline content. A div does not correspond to any particular predetermined thing like a paragraph or column, but can be whatever kind of thing is needed. It is thus general, not semantic markup.
Parameters[edit]
|1=or|text=the content of the div; this parameter usually should be named, because if it is not, the template will break if the div contains an equals sign (=), due to limitations of the MediaWiki software; it is difficult to predict what content other editors might insert into "your" div in the future (for example, a very large number of URLs contain "=" characters, so any inserted source citation could break a div without the|explicit name on the first parameter.|style=apply arbitrary CSS style directives to the content or characteristics of the div; this is by far the most common usage, especially for aspects of the div itself as a container, such as padding, margin, border, background color, width, etc. Do not use quotes; for example|style= color:red; background:green;. For backward compatibility with the old {{DIV}} template the deprecated parameterwill also be passed through as CSS styling.|bodystyle=|title=specify a pop-up "tooltip" that appears when the mouse hovers over the div (in most browsers); the second most common use|class=assign one or more CSS classes to the span|id=assign an HTML ID to the element, e.g. for #linking, CSS styling at a higher level, and other purposes; it must be unique on the page, and begin with an alphabetic letter
See also[edit]
- {{span}} – the inline-level equivalent; it is a wrapper for
<span>...</span> - {{bq}} – another block-level container, for block quotations or other indented objects; it is a wrapper for
<blockquote>...</blockquote> - Category:Wikipedia XHTML tag replacing templates
Parameters
- style / bodystyle
- id
- class
- title
- 1 or text
[edit]
Categories[edit]
