Thông tin tài liệu
226
P a r t I : C o r e M a r k u p
226
P a r t I : C o r e M a r k u p
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
<p><del cite="http://www.democompany.com/changes/oct.html"
datetime="2008-10-06T09:15:00-05:00">
The penalty clause applies to client lateness as well.
</del> <ins>No more penalties</ins></p>
Compatibility
HTML 4, 4.01, 5
XHTML 1.0, 1.1
Firefox 1+, Internet Explorer 4+,
Netscape 6+, Opera 7+, Safari 1+
Notes
• Browsers can render deleted (<del>) 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.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
227
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
227
PART I
• User agents that do not understand <del> or <ins> will show the information
anyway, so there is no harm in adding information—only in deleting it. Because of
the fact that
<del>-enclosed text might show up, it might be wise to comment it out
within the element, as shown here:
<del>
<! This is old information. >
</del>
<details> (Additional Details)
This HTML5 element represents additional information or interactive elements that can be
shown on demand.
HTML5 Standard Syntax
<details
accesskey="spaced list of accelerator key(s)"
class="class name(s)"
contenteditable="true | false | inherit"
contextmenu="id of menu"
data-X="user-defined data"
dir="ltr | rtl"
draggable="true | false | auto"
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"
open="true | false"
spellcheck="true | false"
style="style information"
tabindex="number"
title="advisory text">
dt or dd elements and other content or controls
</details>
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,
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
228
P a r t I : C o r e M a r k u p
228
P a r t I : C o r e M a r k u p
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
<details onclick="this.open='open';">
<dt>Help?</dt>
<dd>
<p>This could give you help with HTML5 but we need more implementations to
prove how things will work.</p>
</dd>
</details>
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.
<dfn> (Definition)
This inline logical element encloses the defining instance of a term. It usually is rendered as
bold or bold italic text.
Standard Syntax
<dfn
class="class name(s)"
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
</dfn>
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"
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
229
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
229
PART I
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
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
<p>The <dfn>dfn</dfn> element is an element which is used to set off the
defining instance of a term. Now that's a self-contained example!</p>
Compatibility
HTML 2, 3.2, 4, 4.01, 5
XHTML 1.0, 1.1, Basic
Firefox 1+, Internet Explorer 2+,
Netscape 6+, Opera 4+, Safari 1+
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
230
P a r t I : C o r e M a r k u p
230
P a r t I : C o r e M a r k u p
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.
<dir> (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)
<dir
class="class name(s)"
compact="compact"
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
li elements only
</dir>
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
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
231
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
231
PART I
Element-Specific Attribute
compact This attribute reduces the white space between list items.
Example
<dir>
<li>Header Files</li>
<li>Code Files</li>
<li>Comment Files</li>
</dir>
Compatibility
HTML 2, 3.2, 4, 4.01 (transitional)
XHTML 1.0 (transitional)
Firefox 1+, Internet Explorer 2+,
Netscape 1+, Opera 2.1+, Safari 1+
Notes
• Because the <dir> 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
<ul> tag
instead.
• Most browsers will not render a
<dir> tag any differently from the <ul> 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:
<dir compact="compact">.
<div> (Division)
This element indicates a generic block of content that should be treated as a logical unit for
scripting or styling purposes.
Standard Syntax
<div
align="center | justify | left | right" (transitional only)
class="class name(s)"
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
</div>
Attributes Introduced by HTML5
accesskey="spaced list of accelerator key(s)"
contenteditable="true | false | inherit"
contextmenu="id of menu"
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
232
P a r t I : C o r e M a r k u p
232
P a r t I : C o r e M a r k u p
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)
data 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
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
233
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
233
PART I
Element-Specific Attribute
nowrap This Internet Explorer–specific attribute is used to control the wrapping of text
within a <div> tag. If set to yes, text should not wrap. The default is no. CSS rules should
be used instead of this attribute.
Examples
<div align="justify">
<! IE syntax >
All text within this division will be justified
</div>
<div class="special" id="div1" style="background-color: yellow;">
Divs are useful for setting arbitrary style
</div>
<div class="container">
<div class="wrapper">
<div class="content"><p>I have divitis</p></div>
</div>
</div>
Compatibility
HTML 3.2, 4, 4.01, 5
XHTML 1.0, 1.1, Basic
Firefox 1+, Internet Explorer 2+,
Netscape 2+, Opera 4+, Safari 1+
Notes
• A <div> tag is a generic block tag and is very useful for binding scripts or styles to
an arbitrary section of a document. It complements <span>, which is used inline.
• Excessive use of
<div> 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 <div> 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.
<dl> (Definition List)
This element encloses a list of terms and definitions. A common use for this element is to
implement a glossary.
Standard Syntax
<dl
class="class name(s)"
compact="compact" (transitional only)
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
234
P a r t I : C o r e M a r k u p
234
P a r t I : C o r e M a r k u p
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
style="style information"
title="advisory text">
dt and dd elements only
</dl>
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
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
235
C h a p t e r 3 : H T M L a n d X H T M L E l e m e n t R e f e r e n c e
235
PART I
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
compact This attribute reduces the white space between list items.
Examples
<dl>
<dt>Cat</dt>
<dd>A domestic animal that likes fish.</dd>
<dt>Skunk</dt>
<dd>A wild animal that needs deodorant.</dd>
</dl>
<! Terms definitions don't have to pair match >
<dl>
<dt>Cat</dt>
<dt>Fritz</dt>
<dt>Sylvester</dt>
<dd>A domestic animal that likes fish.</dd>
<dt>Skunk</dt>
<dt>Pepe Le Pew</dt>
<dd>A wild animal that needs deodorant.</dd>
<dt>Tasmanian Devil</dt>
</dl>
Compatibility
HTML 2, 3.2, 4, 4.01, 5
XHTML 1.0, 1.1, Basic
Firefox 1+, Internet Explorer 2+,
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
<dl> tag or <ul> 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.
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
[...]... ontimeerror Chapter 3: HTML and XHTML Element Reference 251 Element-Specific Attributes action This attribute contains the URL of the server program that will process the contents of the form Some browsers also might support a mailto URL, which can mail the results to the specified address Otherwise, the delivery of the data in the form is defined by the method attribute autocomplete This Microsoft... 2045 The default value for this attribute is the reserved value unknown 252 Part I: Core Markup the parent frame set containing the source link The _self value indicates the frame containing the source link The _top value indicates the full browser window HTML5 may allow for targeting of nonframed regions of the page Example ... 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... attribute should only be set if the developer is familiar with HTAs bordercolor This attribute sets the color of the frame’s border using either a named color or a color specified in the hexadecimal #RRGGBB format frameborder This attribute determines whether the frame is surrounded by an outlined three-dimensional border The HTML specification prefers the use of 1 for the frame border on, and 0 for... src="column1 .html" > the screen, and the other, 80% > Chapter 3: HTML and XHTML Element Reference the screen, and the other, whatever space is left > ... Core Markup • The strict definitions of HTML 4 and XHTML do not include support for the align attribute Style sheet properties like text-align should be used instead • Under HTML5 , these heading elements are used to form an outline of the document (Document Head) This element indicates the document head, which contains descriptive information about the HTML document as well as other supplementary... Safari 1+ Notes • Under the XHTML 1.0 specification, the head element no longer can be implied, but rather must be used in all documents and must have a close tag Under standard, older HTML specifications as well as HTML5 , the element is actually optional • Often, a tag specifying the character set in play should be found as the first child of the head element, particularly if the document’s title... borders within the frame set Setting the value to 0 eliminates all frame borders This attribute is not defined in the HTML or XHTML specification but is widely supported bordercolor This attribute sets the color for frame borders within the frame set using either a named color or a color specified in the hexadecimal #RRGGBB format cols This attribute contains a comma-delimited list that specifies the number... onwaiting Example Document Footer Welcome to the Example Yes it is another boring example. © 2010 Boring Examples, Inc. Chapter 3: HTML and XHTML Element Reference 249 < /html> Compatibility HTML5 Not currently supported... browsers that do not support frames • HTML5 currently does include support for frames beyond the inline frame defined by an tag • The tag replaces the tag in a framing document, as shown here: . class="container">
<div class="wrapper">
<div class="content"><p>I have divitis</p></div>
</div>.
<title>Figure It Out</title>
</head>
<body>
<header><h1>Welcome to the Example</h1></header>
<p>Yes
Ngày đăng: 21/01/2014, 09:20
Xem thêm: Tài liệu HTML & CSS: The Complete Reference- P6 pdf, Tài liệu HTML & CSS: The Complete Reference- P6 pdf