Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
HTML element
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Block elements=== Block elements, or block-level elements, have a rectangular structure. By default, these elements will span the entire width of its parent element, and will thus not allow any other element to occupy the same horizontal space as it is placed on. The rectangular structure of a block element is often referred to as the [[:File: W3C and Internet Explorer box models.svg|box model]], and is made up of several parts. Each element contains the following: * The '''content''' of an element is the actual text (or other media) placed between the opening and closing tags of an element. * The '''padding''' of an element is the space around the content but which still forms part of the element. Padding should not be used to create white space between two elements. Any background style assigned to the element, such as a background image or color, will be visible within the padding. Increasing the size of an element's padding increases the amount of space this element will take up. * The '''border''' of an element is the absolute end of an element and spans the perimeter of that element. The thickness of a border increases the size of an element. * The '''margin''' of an element is the white space that surrounds an element. The content, padding, and border of any other element will not be allowed to enter this area unless forced to do so by some advanced [[CSS]] placement. Using most standard [[Document Type Definition|DTDs]], margins on the left and right of different elements will push each other away. Margins on the top or bottom of an element, on the other hand, will not stack or will intermingle. This means that the white space between these elements will be as big as the larger margin between them. The above section refers only to the detailed implementation of CSS rendering and has no relevance to HTML elements themselves. ====Basic text==== {{glossary}} {{term|term=p |content= {{XMLElement|p|Paragraph}} }} {{defn|1= Creates a paragraph, perhaps the most common block level element.}} {{defn|<code>P</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=h1 |content= {{XMLElement|h1|Level 1 heading}} {{anchor|heading}} }} {{term|term=h2 |content= {{XMLElement|h2|Level 2 heading}} |multi=y}} {{term|term=h3 |content= {{XMLElement|h3|Level 3 heading}} |multi=y}} {{term|term=h4 |content= {{XMLElement|h4|Level 4 heading}} |multi=y}} {{term|term=h5 |content= {{XMLElement|h5|Level 5 heading}} |multi=y}} {{term|term=h6 |content= {{XMLElement|h6|Level 6 heading}} |multi=y}} {{defn|1= Section headings at different levels. <code>h1</code> delimits the highest-level heading, <code>h2</code> the next level down (sub-section), <code>h3</code> for a level below that, and so on to <code>h6</code>. They are sometimes referred to collectively as <code>h''n''</code> tags, ''n'' meaning any of the available heading levels. Most visual browsers show headings as large bold text by default, though this can be overridden with [[Cascading Style Sheets|CSS]]. Heading elements are not intended merely for creating large or bold text – in fact, they should {{em|not}} be used for explicitly styling text. Rather, they describe the document's structure and organization. Some programs use them to generate outlines and tables of contents. }} {{defn|Headings existed in ''[[#HTMLTAGS|HTML Tags]]'', and were '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{glossary end}} ==== Lists ==== {{glossary}} {{anchor|dl}}{{term|term=dl |content= {{XMLElement|dl|Definition List}} }} {{defn|1= {{redirect|Definition list|Wikipedia's article on lists of definitions|Glossary}} A description list (a.k.a. [[association list]] or definition list) consists of name–value groups,<ref name="W3C-5-DL">{{cite web |url=http://www.w3.org/TR/html5/grouping-content.html#the-dl-element |title=4.4 Grouping content – HTML5 |work=HTML5: A vocabulary and associated APIs for HTML and XHTML – W3C Recommendation |publisher=[[World Wide Web Consortium]] |at=§4.4.8 The dl element |date=28 October 2014 |access-date=16 August 2015}}</ref> and was known as a definition list prior to HTML5.<ref>{{cite web |url=http://www.w3.org/TR/html4/struct/lists.html#edef-DL |title=Lists in HTML documents |at=§10.3 Definition lists: the DL, DT, and DD elements |work=HTML 4.01 Specification – W3C Recommendation |date=24 December 1999 |publisher=World Wide Web Consortium |access-date=2 May 2015 }}</ref> Description lists are intended for groups of "terms and definitions, metadata topics and values, questions and answers, or any other groups of name–value data".<ref>{{cite web |website=[[W3C]]|title=HTML5: A Vocabulary and Associated APIs for HTML and XHTML, W3C Working Draft|date=5 April 2011|url=http://www.w3.org/TR/2011/WD-html5-20110405/grouping-content.html#the-dl-element}}.</ref> }} {{defn|<code>DL</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=dt |content= {{XMLElement|dt|Definition Term}} }} {{defn|1= A name in a description list (previously definition term in a definition list).}} {{defn|<code>DT</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=dd |content= {{XMLElement|dd|Definition}} }} {{defn|1= A value in a description list (previously definition data in a definition list).}} {{defn|<code>DD</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=ol |content= {{XMLElement|ol|Ordered List}} }} {{defn|1= An ordered (enumerated) list. The <code>type</code> attribute can be used to specify the kind of marker to use in the list, but style sheets give more control. The default is Arabic numbering. In an HTML attribute: {{nobr|{{code|lang=html|code=<ol type="foo">}}}}; or in a CSS declaration: {{nobr|{{code|lang=css|code=ol { list-style-type: foo; } }}}} – replacing <code><var>foo</var></code> with one of the following: * A, B, C ... – HTML value: <code>A</code>; CSS value: <code>upper-alpha</code> * a, b, c ... – HTML value: <code>a</code>; CSS value: <code>lower-alpha</code> * I, II, III ... – HTML value: <code>I</code>; CSS value: <code>upper-roman</code> * i, ii, iii ... – HTML value: <code>i</code>; CSS value: <code>lower-roman</code> * 1, 2, 3 ... – HTML value: <code>1</code>; <code>decimal</code> CSS provides several other options not available as pure-HTML markup, including <code>none</code>, and options for [[CJK]], Hebrew, Georgian, and Armenian script. The attribute is deprecated in HTML 3.2 and 4.01, but not in HTML 5. }} {{defn|<code>OL</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=ul |content= {{XMLElement|ul|Unordered List}} }} {{defn|1= An unordered (bulleted) list. The type of list item marker can be specified in an HTML attribute: {{nobr|{{code|lang=html|code=<ul type="foo">}}}}; or in a CSS declaration: {{nobr|{{code|lang=css|code=ul { list-style-type: foo; } }}}} – replacing <code><var>foo</var></code> with one of the following (the same values are used in HTML and CSS): <code>disc</code> (the default), <code>square</code>, or <code>circle</code>. '''Only''' the CSS method is supported in HTML5; the attribute is deprecated in HTML 3.2 and 4.01. CSS also provides <code>none</code>, and the ability to replace these bullets with custom images.}} {{defn|<code>UL</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=li |content= {{XMLElement|li|List Item}} }} {{defn|1= A list item in ordered (<code>ol</code>) or unordered (<code>ul</code>) lists.}} {{defn|<code>LI</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=dir |content= {{XMLElement|dir|Directory List|deprecated=1}} }} {{defn|1= A directory listing. The original purpose of this element was never widely supported; deprecated in favor of {{code|lang=html|code=<ul>}}.}} {{defn|<code>DIR</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]].}} {{glossary end}} ==== Other block elements ==== <!--linked from Template:Pre2--> {{glossary}} {{term|term=address |content= {{XMLElement|address|Address}} }} {{defn|1= Contact information for the document author.}} {{defn|<code>ADDRESS</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=article |content= {{XMLElement|article|Article}} }} {{defn|1= {{Main|Article element}} Used for articles and other similar content. }} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=aside |content= {{XMLElement|aside|Aside}} }} {{defn|1= Used for content in a document which is separate from the main page content, for example, sidebars or advertising.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=blockquote |content= {{XMLElement|blockquote|BlockQuotation}}<!-- Linked from [[Wikipedia:Quotations]] --> }} {{defn|1= {{Main|Blockquote element}} A [[blockquote|block level quotation]], for when the quotation includes block level elements, e.g. paragraphs. The <code>cite</code> attribute (not to be confused with the [[#cite|{{tag|cite|o}}]] element) may give the source, and must be a fully qualified [[Uniform Resource Identifier]]. The default presentation of block quotations in visual browsers is usually to indent them from both margins. This has led to the element being unnecessarily used just to indent paragraphs, regardless of semantics. For quotations not containing block level elements see the quote ([[#q|{{tag|q|o}}]]) element. }} {{defn|<code>BLOCKQUOTE</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current. See [[blockquote element]] for more information.}} {{term|term=center |content= {{XMLElement|center|Centered Text|deprecated=1}} }} {{defn|1= Creates a block-level center-aligned division. Deprecated in favor of [[#div|{{tag|div|o}}]] or another element with centering defined using style sheets.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; '''deprecated''' in [[#HTML401|HTML 4.0]]; '''not supported''' in [[#HTML5|HTML5]].}} {{term|term=del |content= {{XMLElement|del|Deleted Section}} }} {{defn|1= Marks a deleted section of content. This element can also be used as ''inline''.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=div |content= {{XMLElement|div|Logical division}} }} {{defn|1= {{Main|Span and div}} A block-level logical division. A generic element with no semantic meaning used to distinguish a document section, usually for purposes such as presentation or behavior controlled by [[Cascading Style Sheets|style sheets]] or [[Document Object Model|DOM]] calls.}} {{defn|Proposed in the [[#HTML30|HTML 3.0 Drafts]]; '''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{term|term=figure |content= {{XMLElement|figure|Figure}} }} {{defn|1= Used to group images and captions, along with {{tag|figcaption|o}}.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=figcaption |content= {{XMLElement|figcaption|Figure Caption}} }} {{defn|1= A caption for an image. Always placed inside the {{tag|figure|o}} element.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=footer |content= {{XMLElement|footer|Footer}} }} {{defn|1= Used for document footers. These might contain author or copyright information, or links to other pages.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=header |content= {{XMLElement|header|Header}} }} {{defn|1= Used for document headers. These typically contain content introducing the page.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=hr |content= {{XMLElement|hr|Thematic break|end=no}} }} {{defn|1= A [[thematic break (formatting)|thematic break]] (originally: horizontal rule). Presentational rules can be drawn with style sheets.}} {{defn|'''Standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=ins |content= {{XMLElement|ins|Inserted Section}} }} {{defn|1= Marks a section of inserted content. This element can also be used as ''inline''.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=main |content= {{XMLElement|main|Main Content}} }} {{defn|1= Contains the main content of a document.}} {{defn|'''Standardized''' in [[#HTML5|HTML 5.1]].}} {{term|term=menu |content= {{XMLElement|menu|Menu}} }} {{defn|1= HTML 2.0: A menu listing. Should be more compact than a {{tag|ul|o}} list.}} {{defn|<code>MENU</code> existed in ''[[#HTMLTAGS|HTML Tags]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; '''deprecated''' in [[#HTML401|HTML 4.0 Transitional]]; '''invalid''' in [[#HTML401|HTML 4.0 Strict]]; then redefined in [[#HTML5|HTML5]], removed in HTML 5.2, but is included in the HTML Living Standard in 2019. }} {{term|term=nav |content= {{XMLElement|nav|Navigation}} }} {{defn|1= Used in navigational sections of articles (areas of webpages which contain links to other webpages).}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=noscript |content= {{XMLElement|noscript|JavaScript Fallback}} }} {{defn|1= Replacement content for scripts. Unlike '''script''' this can only be used as a block-level element.}} {{defn|'''Standardized''' in [[#HTML401|HTML 4.0]]; still current.}} {{term|term=pre |content= {{XMLElement|pre|PreFormatted Text}} }} {{defn|1= ''Pre-formatted'' text. Text within this element is typically displayed in a [[non-proportional font]] exactly as it is laid out in the file (see [[ASCII art]]). Whereas browsers ignore [[Whitespace (computer science)|white-space]] for other HTML elements, in {{tag|pre}}, white-space should be rendered as authored. (With the CSS properties: {{code|lang=css|code={ white-space: pre; font-family: monospace; }<nowiki />}}, other elements can be presented in the same way.) This element can contain any inline element except: [[#image|{{tag|image|o}}]], [[#object|{{tag|object|o}}]], [[#big|{{tag|big|o}}]], [[#small|{{tag|small|o}}]], [[#sup|{{tag|sup|o}}]], and [[#sub|{{tag|sub}}]].}} {{defn|<code>PRE</code> existed in ''[[#HTMLDRAFT12|HTML Internet Draft 1.2]]'', and was '''standardized''' in [[#HTML20|HTML 2.0]]; still current.}} {{term|term=section |content= {{XMLElement|section|Section}} }} {{defn|1= Used for generic sections of a document. This is different from [[#div|{{tag|div|o}}]] in that it is only used to contain sections of a page, which the W3C defines as a group of content with a similar theme.}} {{defn|'''Standardized''' in [[#HTML5|HTML5]].}} {{term|term=script |content= {{XMLElement|script|Script}} }} {{defn|1= Places a script in the document. Also usable in the head and in inline contexts. It may be used as {{tag|script|s}} with a <code>src</code> attribute to supply a URL from which to load the script, or used as {{tag|script}} around embedded script content. {{strong|Note:}} {{tag|script|o}} is not itself either a block or inline element; by itself it should not display at all, but it can contain instructions to dynamically generate either both block or inline content.}} {{defn|'''Standardized''' in [[#HTML32|HTML 3.2]]; still current.}} {{glossary end}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)