HTML & CSS: The Complete Reference- P6

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

0
57
lượt xem
6
download

HTML & CSS: The Complete Reference- P6

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- p6', 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- P6

  1. 226 Part I: Core Markup NOTE MSDN documentation for this element appears incorrect for event handlers. Not all core events are listed, but during testing they all worked. Other extended events like onbeforecopy, oncopy, oncontextmenu, and more were also verified as functional under Internet Explorer 8. Element-Specific Attributes cite The value of this attribute is a URL that designates a source document or message that might explain why the information was deleted. datetime This attribute is used to indicate the date and time the deletion was made. The value of the attribute is a date in a special format as defined by ISO 8601. The basic date format is YYYY-MM-DDThh:mm:ssTZD where the following is true: YYYY=four-digit year such as 1999 MM=two-digit month (01=January, 02=February, and so on.) DD=two-digit day of the month (01 through 31) hh=two-digit hour (00 to 23) (24-hour clock, not AM or PM) mm=two-digit minute (00 through 59) ss=two-digit second (00 through 59) TZD=time zone designator The time zone designator is either Z, which indicates Universal Time Coordinate or coordinated universal time format (UTC), or +hh:mm, which indicates that the time is a local time that is hh hours and mm minutes ahead of UTC. Alternatively, the format for the time zone designator could be –hh:mm, which indicates that the local time is behind UTC. Note that the letter T actually appears in the string, all digits must be used, and 00 values for minutes and seconds might be required. An example value for the datetime attribute might be 1999-10-6T09:15:00-05:00, which corresponds to October 6, 1999, 9:15 A.M., U.S. Eastern Standard Time. Example The penalty clause applies to client lateness as well. No more penalties Compatibility HTML 4, 4.01, 5 Firefox 1+, Internet Explorer 4+, XHTML 1.0, 1.1 Netscape 6+, Opera 7+, Safari 1+ Notes • Browsers can render deleted () text in a different style to show the changes that have been made to the document. Internet Explorer renders the deleted text as strikethrough text. Eventually, a browser could have a way to show a revision history on a document.
  2. Chapter 3: HTML and XHTML Element Reference 227 • User agents that do not understand or will show the information anyway, so there is no harm in adding information—only in deleting it. Because of the fact that -enclosed text might show up, it might be wise to comment it out PART I within the element, as shown here: (Additional Details) This HTML5 element represents additional information or interactive elements that can be shown on demand. HTML5 Standard Syntax dt or dd elements and other content or controls Element-Specific Attribute open This Boolean attribute indicates whether details should be shown to the user. If not they are not shown, and would likely be exposed via a script event. 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,
  3. 228 Part I: Core Markup 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 Example Help? This could give you help with HTML5 but we need more implementations to prove how things will work. Compatibility HTML5 Not currently supported by any browser, but addressed with a custom element. Notes • This element may contain one dt element describing the caption of the detailed content, and one dd element, which contains the content to show. • In early drafts of HTML5 specification, the legend element was used instead of the dt and dd elements added later. (Definition) This inline logical element encloses the defining instance of a term. It usually is rendered as bold or bold italic 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"
  4. Chapter 3: HTML and XHTML Element Reference 229 itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" PART I 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, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onselectstart Example The dfn element is an element which is used to set off the defining instance of a term. Now that's a self-contained example! Compatibility HTML 2, 3.2, 4, 4.01, 5 Firefox 1+, Internet Explorer 2+, XHTML 1.0, 1.1, Basic Netscape 6+, Opera 4+, Safari 1+
  5. 230 Part I: Core Markup Notes • HTML 2 and 3.2 defined no attributes for this element. • HTML5 suggests that the section or content grouping nearest an occurrence of a dfn element must contain the actual definition. (Directory List) This element encloses a list of brief, unordered items, such as might occur in a menu or directory. It is deprecated or obsolete under most specifications. Standard Syntax (Transitional Only—Deprecated) li elements only 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 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
  6. Chapter 3: HTML and XHTML Element Reference 231 Element-Specific Attribute compact This attribute reduces the white space between list items. PART I Example Header Files Code Files Comment Files Compatibility HTML 2, 3.2, 4, 4.01 (transitional) Firefox 1+, Internet Explorer 2+, XHTML 1.0 (transitional) Netscape 1+, Opera 2.1+, Safari 1+ Notes • Because the tag is supposed to be used with short lists, the items in the list should have a maximum width of 20 characters. This is rarely if ever respected. • The HTML and XHTML strict specifications do not support this element, and the HTML5 specification has marked it as obsolete and suggests using a tag instead. • Most browsers will not render a tag any differently from the tag. • HTML 2 and 3.2 define only the compact attribute. • Most browsers will not render the compact list style. • For XHTML transitional compatibility, the compact attribute must have a value: . (Division) This element indicates a generic block of content that should be treated as a logical unit for scripting or styling purposes. Standard Syntax Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu"
  7. 232 Part I: Core Markup 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) datafld="name of column supplying bound data" (4) dataformatas="html | text" (4) datasrc="id of data source object supplying data" (4) disabled="false | true" (5.5) hidefocus="true | false" (5.5) language="javascript | jscript | vbs | vbscript" (4) nowrap="no | yes" (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
  8. Chapter 3: HTML and XHTML Element Reference 233 Element-Specific Attribute nowrap This Internet Explorer–specific attribute is used to control the wrapping of text PART I within a tag. If set to yes, text should not wrap. The default is no. CSS rules should be used instead of this attribute. Examples All text within this division will be justified Divs are useful for setting arbitrary style I have divitis Compatibility HTML 3.2, 4, 4.01, 5 Firefox 1+, Internet Explorer 2+, XHTML 1.0, 1.1, Basic Netscape 2+, Opera 4+, Safari 1+ Notes • A tag is a generic block tag and is very useful for binding scripts or styles to an arbitrary section of a document. It complements , which is used inline. • Excessive use of tags is almost as bad as excessive use of tables, particularly when structuring page content. • The HTML 4 specification specifies that the datafld, dataformatas, and datasrc attributes are reserved for and might be supported in the future. They were removed from XHTML, but Internet Explorer supports them for data binding. • Under the HTML 4.01 strict specification, the align attribute is not supported. • HTML 3.2 supports only the align attribute. (Definition List) This element encloses a list of terms and definitions. A common use for this element is to implement a glossary. Standard Syntax
  9. 234 Part I: Core Markup dir="ltr | rtl" id="unique alphanumeric identifier" lang="language code" style="style information" title="advisory text"> dt and dd 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" 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 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
  10. Chapter 3: HTML and XHTML Element Reference 235 Events Defined by Internet Explorer onactivate, onbeforeactivate, onbeforecopy, onbeforecut, onbeforedeactivate, onbeforeeditfocus, onbeforepaste, onblur, onclick, oncontextmenu, PART I 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 compact This attribute reduces the white space between list items. Examples Cat A domestic animal that likes fish. Skunk A wild animal that needs deodorant. Cat Fritz Sylvester A domestic animal that likes fish. Skunk Pepe Le Pew A wild animal that needs deodorant. Tasmanian Devil 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 • The items in the list comprise two parts: the term, indicated by the dt element, and its definition, indicated by the dd element. However, there is no requirement to match these elements, alternate them, or anything else, at least syntax-wise. • Some page designers might use a tag or tag to create text indention. Although this is a common practice on the Web, it is not advisable because it confuses the meaning of the element by making it a physical layout device rather than a list. A CSS property like margin or position should be used instead.
  11. 236 Part I: Core Markup • HTML 2 and 3.2 support only the compact attribute for this element. • For XHTML compatibility, the compact attribute must be expanded: under the transitional form. It is deprecated under the strict specification. In practice, regardless of whether it is indicated, the compact attribute generally has no effect. (Term in a Definition List or Caption in Figure or Details) This element identifies a definition list term in a list of terms and definitions. Under HTML5, the element is also used within and tags to represent a caption for content. 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) nowrap="true | false" (5.5) tabindex="number" (5.5) unselectable="on | off" (5.5) HTML 4 Event Attributes onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup
  12. Chapter 3: HTML and XHTML Element Reference 237 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, 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 nowrap This Internet Explorer–specific attribute is used to control the wrapping of text within a tag. If set to yes, text should not wrap. The default is no. CSS properties should be used instead of this attribute. Examples Vole Small creature related to the weasel Weasel Small creature related to the vole Important Notes This tag seems to be reused too much under HTML5! Moose Baby! A photo of Desmond circa 2010.
  13. 238 Part I: Core Markup 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 • Traditionally, this element occurs within a list of defined terms enclosed by a tag. It is generally used in conjunction with a tag, which indicates its definition. However, tags do not require a one-to-one correspondence with tags. • HTML5 overloads the meaning of this element so that it also serves as the caption of content enclosed within and tags. • Under early drafts of HTML5,this element is also found within tags and defines the speakers of particular statements. When used within such tags, it must be paired with tags in a one-to-one fashion. That syntax was eventually dropped. • The close tag for the element is optional under older versions of HTML as well as HTML5, but including it is suggested, especially when it will make things clearer, particularly with multiple-line definitions. • Under XHTML 1.0, the closing tag is mandatory. • HTML 2 and 3.2 support no attributes for this element. (Emphasis) This inline element indicates emphasized text, which many browsers will display as italic 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"
  14. Chapter 3: HTML and XHTML Element Reference 239 itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" PART I 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 Example This is the important point to consider, not this other less exciting point. 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+
  15. 240 Part I: Core Markup Notes • As a logical element, em is a prime candidate to bind style information to. For example, to define emphasis to mean a larger font size in the Impact font instead of italics, you might use a CSS rule like the following in a document-wide style sheet: em {font-size: larger; font-family: Impact; font-style: normal;} • HTML 2 and 3.2 support no attributes for this element. (Embedded Object) This widely supported nonstandard element specifies an object, typically a multimedia element, to be embedded in an HTML document. The syntax can be somewhat variable given the plug-in–specific attributes found, so the reference covers those commonly found. Proprietary Syntax (Commonly Supported) Attributes Introduced by HTML5 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"
  16. Chapter 3: HTML and XHTML Element Reference 241 itemscope="itemscope" itemtype="microdata type in URL format" spellcheck="true | false" tabindex="number" PART I 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, onbeforecut, onbeforedeactivate, onbeforepaste, onblur, oncontextmenu, oncontrolselect, oncut, ondeactivate, onfocus, onfocusin, onfocusout, onhelp, onload, onlosecapture, onmouseenter, onmouseleave, onmousewheel, onmove, onmoveend, onmovestart, onpaste, onpropertychange, onreadystatechange, onresize, onresizeend, onresizestart, onscroll Element-Specific Attributes align This attribute controls the alignment of adjacent text with respect to the embedded object. The default value is left. alt This attribute indicates the text to be displayed if the embedded object cannot be executed. border This attribute specifies the size, in pixels, of the border around the embedded object. code This attribute specifies the name of the file containing the compiled Java class if the embed element is used to include a Java applet. This is a strange alternative form of Java inclusion documented by Microsoft. codebase This specifies the base URL for the plug-in or potential applet in the case of the alternative form under Internet Explorer. name This attribute specifies a name for the embedded object, so that it can be referenced by client-side programs in an embedded scripting language. palette This attribute is used only on Windows systems to select the color palette used for the plug-in and might be set to background or foreground. The default is background. pluginspage This attribute contains the URL of instructions for installing the plug-in required to render the embedded object.
  17. 242 Part I: Core Markup src This attribute specifies the URL of source content for the embedded object. type This attribute specifies the MIME type of the embedded object. It is used by the browser to determine an appropriate plug-in for rendering the object. It can be used instead of the src attribute for plug-ins that have no content or that fetch it dynamically. units This Netscape 4+–specific attribute is used to set the units for measurement for the embedded object in pixels or as a relative em value. vspace This attribute specifies, in pixels, the size of the top and bottom margins between the embedded object and surrounding text. Example Compatibility No standard initially, but widely supported Firefox 1+, Internet Explorer 4+, HTML5 Netscape 2+, Opera 4+, Safari 1+ Notes • Historically, it has been unclear whether or not the close tag for is required. Many sites tended not to use it, and documentation is not consistent. A close tag should be required and should surround any alternative content in a noembed element. • This element was supposed to be phased out in favor of the object element, but so far its usage seems to have diminished only slightly. • The embed element is not favored by the W3C and was dropped by (X)HTML specifications previous to HTML5. • Embedded objects are multimedia content files of arbitrary type that are rendered by browser plug-ins. The type attribute uses a file’s MIME type to determine an appropriate browser plug-in. Any attributes not defined are treated as object-specific parameters and are passed through to the embedded object. Consult the plug-in or object documentation to determine these. (Form Field Grouping) This element allows form designers to group thematically related controls together. The element usually contains a legend element, which labels the grouped form controls. Standard Syntax
  18. Chapter 3: HTML and XHTML Element Reference 243 id="unique alphanumeric identifier" lang="language code" style="style information" title="advisory text"> PART I Attributes Introduced by HTML5 accesskey="spaced list of accelerator key(s)" contenteditable="true | false | inherit" contextmenu="id of menu" data-X="user-defined data" disabled="disabled" draggable="true | false | auto" form="id of related form" 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="char" (5.5) align="center | left | right" (4) contenteditable="false | true | inherit" (5.5) datafld="name of column supplying bound data" (4) 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
  19. 244 Part I: Core Markup 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 Example Customer Identification Customer Name: Compatibility HTML 4, 4.01, 5 Firefox 1+, Internet Explorer 4+, XHTML 1.0, 1.1 Netscape 6+, Opera 4+, Safari 1+ Notes • Grouping controls makes it easier for users to understand the purposes of the controls while simultaneously facilitating tabbing navigation for visual user agents and speech navigation for speech-oriented user agents. The proper use of this element makes documents more accessible to users with disabilities. • The full set of data-binding attributes likely needs to be bound to this element but is missing from MSDN documentation. • The caption for a tag can be defined by the legend element. There should only be a single legend element within the element. (Figure) This HTML5 element represents a group of content enclosed in a dd element, often with a caption defined by a dt element, that can be moved away from the main flow of the document. The way in which this element is implemented is similar to how the figures in this book are presented—not necessarily directly adjacent to the text discussing them. HTML5 Standard Syntax
  20. Chapter 3: HTML and XHTML Element Reference 245 draggable="true | false | auto" hidden="hidden" id="unique alphanumeric identifier" itemid="microdata id in URL format" PART I itemprop="microdata value" itemref="space-separated list of IDs that may contain microdata" itemscope="itemscope" itemtype="microdata type in URL format" lang="language code" 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 Example Figure It Out Welcome to the Example Yes it is another boring example. In this case we would like you to review Figure Ex-1 More and more text is found until eventually the figure is located. The mighty fig tag has returned from HTML 3 as figure to haunt your dreams. Figure Ex-1 Maybe some more content here.
Đồng bộ tài khoản