HTML & CSS: The Complete Reference- P8

Chia sẻ: Thanh Cong | Ngày: | Loại File: PDF | Số trang:50

0
45
lượt xem
5
download

HTML & CSS: The Complete Reference- P8

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Tham khảo tài liệu 'html & css: the complete reference- p8', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả

Chủ đề:
Lưu

Nội dung Text: HTML & CSS: The Complete Reference- P8

  1. 326 Part I: Core Markup Compatibility No standards support Netscape 3, 4, 4.5–4.8 Notes • Page developers are strongly encouraged not to use this element. Netscape dropped this element for its own browsers starting with version 6.0. The inclusion in this book of this element is for support of existing documents only. • The facilities of this element are better handled using the CSS multicolumn properties discussed in Chapter 6. (Navigation) This HTML5 element represents a group of links to other locations either inside or outside of a document. HTML5 Standard Syntax text and elements particularly links HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange,
  2. Chapter 3: HTML and XHTML Element Reference 327 onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Example PART I About Services Contact Home Compatibility HTML5 Not currently supported by any browser, but addressed with a custom element. Notes • Links are not restricted to occur solely within tags. The intent of this element is that it collects navigation together often as a unit; commonly this would be primary or secondary site navigation or possibly page-related links. • While this element is not yet supported, it is easily simulated by using a custom tag or using a tag with a special class. (No Line Breaks) This proprietary element renders enclosed text without line breaks. Break points for where text may wrap can be inserted using the wbr element or related workarounds. Common Syntax Attributes Defined by Internet Explorer contenteditable=" false | true | inherit " (5.5) dir="ltr | rtl" (5.5) disabled="false | true" (5.5) unselectable="on | off" (5.5) Events Defined by Internet Explorer onbeforeactivate, onbeforecopy, onbeforecut, onbeforeedit, onbeforepaste, oncopy, oncut, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocusin, onfocusout, onhelp, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onpaste, onpropertychange, onreadystatechange, onscroll, onselectstart
  3. 328 Part I: Core Markup Examples This really long text ... will not be broken. With this element it is often important to hint where a line may be broken using <wbr>. This element acts as a soft return. Compatibility No standards support Firefox 1+, Internet Explorer 4+, Netscape 1.1+, Opera 4+ Notes • While many browsers support this attribute, it is not part of any W3C standard. • See the “ (Word Break)” section later in the chapter for a discussion of how to implement soft-break functionality without the proprietary wbr element. (No Embedded Media Support) This Netscape-introduced element is used to indicate alternative content to be displayed on browsers that cannot support an embedded media object. It should occur in conjunction with the embed element. Proprietary Syntax (Initially Defined by Netscape) Alternative content for browsers that do not support embed Element-Specific Attributes Netscape does not specifically define attributes for this element; however, testing and documentation suggests that class, id, style, and title might be supported for this element in many browsers. Example This browser is not configured to display video Compatibility No standards support Netscape 2, 3, 4–4.7
  4. Chapter 3: HTML and XHTML Element Reference 329 Note • Even if other browsers do not support the tag and render the contents of a tag, it works in the manner it was designed, given how browsers handle PART I unknown elements. (No Frame Support Content) This element is used to indicate alternative content to be displayed on browsers that do not support frames. Standard Syntax Alternative content for browsers that do not support frames HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup Event Defined by Internet Explorer onreadystatechange Example Sorry, this browser does not support frames. Compatibility HTML 4, 4.01 (transitional and frameset) Firefox 1+, Internet Explorer 2+, XHTML 1.0 (transitional and frameset) Netscape 2+, Opera 4+, Safari 1+ Notes • This element should be used within the scope of the frameset element. • This element has no inclusion under HTML5 because standard frames are not included in that specification.
  5. 330 Part I: Core Markup • The benefit of events and sophisticated attributes, such as style, is unclear for browsers that would use content within , given that older browsers that don’t support frames probably would not support these features. (No Script Support Content) This element is used to enclose content that should be rendered on browsers that do not support scripting or that have scripting turned off. Syntax Alternative content for non-script-supporting browsers Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" tabindex="number" HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting
  6. Chapter 3: HTML and XHTML Element Reference 331 Event Defined by Internet Explorer onreadystatechange PART I Examples JavaScript is not supported. Follow this link instead. Web Application Compatibility HTML 4, 4.01, 5 Firefox 1+, Internet Explorer 3+, XHTML 1.0, 1.1 Netscape 2+, Opera 4+, Safari 1+ Note • Besides using the noscript element, it may be wise to employ a comment mask around any script code that is embedded rather than linked. Oddly, under HTML 4 is not allowed in the head even though is. Under HTML5 it is allowed, though with a limited set of content within it and is not defined when XML syntax is used. (Embedded Object) This element specifies an arbitrary object to be included in an HTML document. Initially, this element was used to insert ActiveX controls, but according to the specification, an object can be any media object, document, applet, interactive control, or even image. Standard Syntax
  7. 332 Part I: Core Markup class="class name(s)" classid="id" codebase="URL" codetype="MIME Type" data="URL of data" declare="declare" dir="ltr | rtl" height="percentage | pixels" hspace="percentage | pixels" (transitional only) id="unique alphanumeric identifier" lang="language code" name="unique alphanumeric name" standby="standby text string" style="style information" tabindex="number" title="advisory text" type="MIME Type" usemap="URL" vspace="percentage | pixels" (transitional only) width="percentage | pixels"> param elements and alternative rendering Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" Attributes Defined by Internet Explorer accesskey="character" (4) align="absbottom | absmiddle | baseline | texttop" (4) code="URL" (4) datafld="column name" (4) datasrc="id for bound data" (4) hidefocus="true | false" (5.5) language="javascript | jscript | vbs | vbscript" (4) unselectable="on | off" (5.5) HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup
  8. Chapter 3: HTML and XHTML Element Reference 333 HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, PART I ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Events Defined by Internet Explorer onactivate, onbeforedeactivate, onbeforeeditfocus, onblur, oncellchange, onclick, oncontrolselect, ondataavailable, ondatasetchanged, ondatasetcomplete, ondblclick, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, onlosecapture, onmove, onmoveend, onmovestart, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onrowenter, onrowexit, onrowsdelete, onrowsinserted, onscroll, onselectstart Element-Specific Attributes align This attribute aligns the object with respect to the surrounding text. The default is left. The HTML specification defines bottom, middle, right, and top, as well. Browsers might provide an even richer set of alignment values. The behavior of alignment for objects is similar to images. Under the strict HTML and XHTML specifications, the object element does not support this attribute. archive This attribute contains a URL for the location of an archive file. An archive file typically is used to contain multiple object files to improve the efficiency of access. border This attribute specifies the width of the object’s borders, in pixels or as a percentage. classid This attribute contains a URL for an object’s implementation. The URL syntax depends upon the object’s type. With ActiveX controls, the value of this attribute does not appear to be a URL but something of the form CLSID: object-id; for example, CLSID: 99B42120-6EC7-11CF-A6C7-00AA00A47DD2. code Under the old Microsoft implementation, this attribute contains the URL referencing a Java applet class file. The way to access a Java applet under the HTML/XHTML specification is to use . The pseudo-URL java: is used to indicate a Java applet. Microsoft Internet Explorer 4 and beyond support this style, so code should not be used. codebase This attribute contains a URL to use as a relative base to access the object specified by the classid attribute. codetype This attribute specifies an object’s MIME type. Do not confuse this attribute with type, which specifies the MIME type of the data the object may use, as defined by the data attribute.
  9. 334 Part I: Core Markup data This attribute contains a URL for data required by an object. declare This attribute declares an object without instantiating it. This is useful when the object will be a parameter to another object. In traditional HTML, this attribute takes no value; under XHTML, set it equal to declare. name Under the older forms of HTML, this attribute defines the name of the control so that scripting can access it. The id attribute should be used if possible. standby This attribute contains a text message to be displayed while the object is loading. type This attribute specifies the MIME type for the object’s data. This is different from codetype, which is the MIME type of the object and not of the data it uses. usemap This attribute contains the URL of the image map to be used with the object. Typically, the URL will be a fragment identifier referencing a map element somewhere else within the file. The presence of this attribute indicates that the type of object being included is an image. vspace This attribute indicates the vertical space, in pixels or as a percentage, between the object and surrounding text. Examples Hello World for non-ActiveX users! This will display in non-Java-aware or -enabled browsers. Data not included!
  10. Chapter 3: HTML and XHTML Element Reference 335 Compatibility HTML 4, 4.01, 5 Firefox 1+, Internet Explorer 3+, PART I XHTML 1.0, 1.1, Basic Netscape 4+, Opera 4+, Safari 1+ Notes • Under the strict HTML and XHTML specifications, the object element loses most of its presentation attributes, including align, border, height, hspace, vspace, and width. These attributes are replaced by style sheet rules. • The HTML 4.01 specification reserves the datafld, dataformatas, and datasrc attributes for future use. However, these attributes were dropped in XHTML, though they are well supported by Internet Explorer 4 and beyond. • Alternative content should be defined within an tag after any enclosed tags. • The object element is still mainly used to include multimedia binaries in pages. Although the specification defines that it can load in HTML files, insert a variety of other objects, and create image maps, not every browser supports this, and few developers are aware of these features. In theory, this very versatile tag should take over duties from the venerable tag in future specifications, though given the media-specific element trends of HTML5, this seems unlikely to happen. (Ordered List) This element is used to define an ordered or numbered list of items. The numbering style comes in many forms, including letters, Roman numerals, and regular numerals. The individual items within the list are specified by li elements included with the ol element. Standard Syntax (transitional only)> li elements only Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data"
  11. 336 Part I: Core Markup draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" reversed="reversed" spellcheck="true | false" tabindex="number" Attributes Defined by Internet Explorer accesskey="key" (5.5) contenteditable="false | true | inherit" (5.5) disabled="false | true" (5.5) hidefocus="true | false" (5.5) language="javascript | jscript | vbs | vbscript" (4) tabindex="number" (5.5) unselectable="on | off" (5.5) HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Events Defined by Internet Explorer onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, onclick, oncontextmenu, oncontrolselect, oncopy, oncut, ondblclick, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onkeydown, onkeypress, onkeyup, onlosecapture, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart, ontimeerror Element-Specific Attributes compact This attribute indicates that the list should be rendered in a compact style. Few browsers actually change the rendering of the list, regardless of the presence of this attribute. The compact attribute requires no value under traditional HTML but under XHTML should be set to compact.
  12. Chapter 3: HTML and XHTML Element Reference 337 reversed This HTML5 Boolean attribute specifies that the counting of the list should go in reverse order. CSS counters provide much more functionality than this attribute, but it is useful in the absence of this more complicated syntax. PART I start This attribute specifies the start value for numbering the individual list items. Although the ordering type of list elements might be Roman numerals, such as XXXI, or letters, the value of start is always represented as a number. To start numbering elements from the letter C, use . type This attribute indicates the numbering type: a indicates lowercase letters, A indicates uppercase letters, i indicates lowercase Roman numerals, I indicates uppercase Roman numerals, and 1 indicates numbers. Type set in an ol element is used for the entire list unless a type attribute is used within an enclosed li element. Examples First step Watch nested lists Often closed wrong Second step Third step Clause 30 Clause 31 Clause 32 ... ... ... Blastoff! Compatibility HTML 2, 3.2, 4, 4.01, 5 Firefox 1+, Internet Explorer 2+, XHTML 1.0, 1.1, Basic Netscape 1+, Opera 4+, Safari 1+ Notes • Under the strict HTML and XHTML specifications, the ol element no longer supports the compact, start, and type attributes. These aspects of lists can be controlled with style sheet rules.
  13. 338 Part I: Core Markup • HTML5 returns the start attribute to ordered lists and adds the reversed attribute. • Under the XHTML 1.0 specification, the compact attribute must have a quoted attribute value: . • The HTML 3.2 specification supports only the compact, start, and type attributes. • The HTML 2.0 specification supports only the compact attribute. (Option Grouping) This element specifies a grouping of items in a selection list defined by option elements so that the menu choices can be presented in a hierarchical menu or similar alternative fashion to improve access through nonvisual browsers. Standard Syntax option elements Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" tabindex="number" HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
  14. Chapter 3: HTML and XHTML Element Reference 339 ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, PART I onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Element-Specific Attributes disabled Occurrence of this attribute indicates that the enclosed set of options is disabled. label This attribute contains a short label to use when the selection list is rendered as items in a hierarchy. Example Where would you like to go for your vacation? Hong Kong Australia Wakaya (Fiji Islands) New Zealand Your backyard Compatibility HTML 4, 4.01, 5 Firefox 1+, Internet Explorer 6+, XHTML 1.0, 1.1 Netscape 6+, Opera 7+, Safari 1+ Notes • This element should occur only within the context of a select element. • The visual presentation of this element may vary slightly between browsers. (Option in Selection List) This element specifies an item in a selection list defined by a select element. Standard Syntax
  15. 340 Part I: Core Markup label="text description" lang="language code" selected="selected" style="style information" title="advisory text" value="option value"> Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" tabindex="number" Attribute Defined by Internet Explorer language="javascript | jscript | vbs | vbscript" (4) HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Events Defined by Internet Explorer onlayoutcomplete, onlosecapture, onpropertychange, onreadystatechange, onselectstart, ontimeerror Element-Specific Attributes disabled Presence of this attribute indicates that the particular item is not selectable. Traditional HTML did not require a value for this attribute, but it should be set to disabled under XHTML.
  16. Chapter 3: HTML and XHTML Element Reference 341 label This attribute contains a short label that might be more appealing to use when the selection list is rendered as a hierarchy due to the presence of an optgroup element. PART I selected This attribute indicates that the associated item is the default selection. If this attribute is not included, the first item in the selection list is the default. If the select element enclosing the option elements has the multiple attribute, the selected attribute might occur in multiple entries. Otherwise, it should occur in only one entry. Under XHTML, the value of the selected attribute must be set to selected. value This attribute indicates the value to be included with the form result when the item is selected. Example Which is your favorite dog?: Angus" Tucker Sabrina Lucky Compatibility HTML 2, 3.2. 4, 4.01, 5 Firefox 1+, Internet Explorer 2+, XHTML 1.0, 1.1, Basic Netscape 1+, Opera 2.1+, Safari 1+ Notes • Under HTML specifications, the closing tag for is optional. However, for XHTML compatibility, the closing tag is required. • This element should occur only within the context of a select element. • The HTML 2.0 and 3.2 specifications define only the selected and value attributes for this element. (Form Output) This HTML5 block element defines a region that will be used to display output from some calculation or form control. HTML5 Standard Syntax
  17. 342 Part I: Core Markup form="id of related form element" hidden="hidden" id="unique alphanumeric identifier" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" lang="language code" name="element name for submission purposes" spellcheck="true | false" style="style information" tabindex="number" title="advisory text"> HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Element-Specific Attributes for This attribute should be set to the id value(s) of the elements that target this element. form This attribute should be set to the id value of the form element that the output element is associated with; otherwise, the nearest parent form is used. name This attribute should set the name to be used in a name/value pair if the element is used in form submission. Examples HTML5 released in the year   Compatibility HTML5 Not currently supported by any browser, but addressed with a custom element.
  18. Chapter 3: HTML and XHTML Element Reference 343 Note • This element supports two useful event handlers that are globally defined by HTML5, onformchange and onforminput, if the element will be used to monitor PART I forms it is associated with rather than forms targeting it. (Paragraph) This block element is used to define a paragraph of text. Standard Syntax Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" tabindex="number" Attributes Defined by Internet Explorer accesskey="key" (5.5) contenteditable="false | true | inherit" (5.5) disabled="false | true" (5.5) hidefocus="true | false" (5.5) language="javascript | jscript | vbs | vbscript" (4) tabindex="number" (5.5) unselectable="on | off" (5.5) HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup
  19. 344 Part I: Core Markup HTML5 Event Attributes onabort, onblur, oncanplay, oncanplaythrough, onchange, onclick, oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, onformchange, onforminput, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, onplay, onplaying, onprogress, onratechange, onreadystatechange, onscroll, onseeked, onseeking, onselect, onshow, onstalled, onsubmit, onsuspend, ontimeupdate, onvolumechange, onwaiting Events Defined by Internet Explorer onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, onclick, oncontextmenu, oncontrolselect, oncopy, oncut, ondblclick, ondeactivate, ondrag, ondragend, ondragenter, ondragleave, ondragover, ondragstart, ondrop, onfocus, onfocusin, onfocusout, onhelp, onkeydown, onkeypress, onkeyup, onlosecapture, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart, ontimeerror Element-Specific Attribute align This attribute specifies the alignment of text within a paragraph. The default value is left. The transitional specification of HTML 4.01 also defines center, justify, and right. However, under the strict HTML and XHTML specifications, text alignment can be handled through the CSS property text-align. Examples A right-aligned paragraph This is the introductory paragraph for a very long paper about nothing. Compatibility HTML 2, 3.2, 4, 4.01, 5 Firefox 1+, Internet Explorer 2+, XHTML 1.0, 1.1, Basic Netscape 1+, Opera 2.1+, Safari 1+ Notes • Because p is a block element, browsers typically insert a blank line, but this rendering should not be assumed, given the rise of style sheets, which can use the display property to override this action. • Under the strict (X)HTML and HTML5 specifications, the align attribute is not supported. Alignment of text can instead be accomplished using CSS properties like text-align.
  20. Chapter 3: HTML and XHTML Element Reference 345 • The closing tag for the tag is optional under the HTML specification; however, under the XHTML 1.0 specification, the closing tag is required for XHTML compatibility. PART I • As a logical element, empty paragraphs are ignored by browsers, so do not try to use multiple tags in a row, like , to add blank lines to a Web page. • Often, nonbreaking space entities are used to hold open empty paragraphs, like so:  . The value of this markup is questionable. • The HTML 3.2 specification supports only the align attribute with values of center, left, and right. • The HTML 2.0 specification supports no attributes for the p element. (Object Parameter) This element specifies a parameter to be passed to an embedded object that is specified with the object or applet element. This element should occur only within the scope of one of these elements. Standard Syntax Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" draggable="true | false | auto" hidden="hidden" itemid="microdata id in URL format" itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" tabindex="number" Attributes Defined by Internet Explorer datafld="column name" (4) dataformatas="html | text" (4) datasrc="data source id" (4)
Đồng bộ tài khoản