Tài liệu Web Programming with HTML, XHTML, and CSS Second Edition- P15 - Pdf 92

image
uri-list vnd.in3d.spot vnd.sun.j2me.app-descriptor
vnd.abc vnd.IPTC.NewsML vnd.wap.si
vnd.curl vnd.IPTC.NITF vnd.wap.sl
vnd.DMClientScript vnd.latex-z vnd.wap.wml
vnd.fly vnd.motorola.reflex vnd.wap.wmlscript
vnd.fmi.flexstor vnd.ms-mediapackage xml
vnd.in3d.3dml vnd.net2phone.commcenter.command xml-external-parsed-entity
bmp tiff-fx vnd.mix
cgm vnd.cns.inf2 vnd.ms-modi
g3fax vnd.djvu vnd.net-fpx
gif vnd.dwg vnd.sealed.png
ief vnd.dxf vnd.sealedmedia.softseal.gif
jpeg vnd.fastbidsheet vnd.sealedmedia.softseal.jpg
naplps vnd.fpx vnd.svf
png vnd.fst vnd.wap.wbmp
prs.btif vnd.fujixerox.edmics-mmr vnd.xiff
prs.pti vnd.fujixerox.edmics-rlc x-portable-pixmap
t38 vnd.globalgraphics.pgb x-xbitmap
tiff vnd.microsoft.icon
671
Appendix H: MIME Media Types
59313bapp08.qxd:WroxPro 3/23/08 2:35 PM Page 671
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
multipart
audio
32kadpcm G726-24 MP4A-LATM
AMR G726-32 mpa-robust
AMR-WB G726-40 mpeg
basic G728 mpeg4-generic
CN G729 parityfec

JPEG SMPTE292M x-sgi-movie
MP1S vnd.fvt x-msvideo
MP2P vnd.motorola.video
MP2T vnd.motorola.videop
VDVI vnd.nokia.mobile-xmf vnd.sealedmedia.softseal.mpeg
vnd.3gpp.iufp vnd.nortel.vbk vnd.vmx.cvsd
vnd.cisco.nse vnd.nuera.ecelp4800 x-aiff
vnd.cns.anp1 vnd.nuera.ecelp7470 x-midi
vnd.cns.inf1 vnd.nuera.ecelp9600 x-mod
vnd.digital-winds vnd.octel.sbc x-mp3
vnd.everad.plj vnd.qcelp — deprecated, use
audio/qcelp
x-wav
vnd.lucent.voice vnd.rhetorex.32kadpcm
673
Appendix H: MIME Media Types
59313bapp08.qxd:WroxPro 3/23/08 2:35 PM Page 673
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
message
model
application
activemessage cpl+xml eshop
andrew-inset cybercash font-tdpfr
applefile dca-rft http
atomicmail dec-dx hyperstudio
batch-SMTP dicom iges
beep+xml dvcs index
cals-1840 EDI-Consent index.cmd
cnrp+xml EDIFACT index.obj
commonground EDI-X12 index.response

parityfec sdp vnd.aether.imp
pdf set-payment vnd.amiga.ami
pgp-encrypted set-payment-initiation vnd.anser-web-certificate-issue-initiation
pgp-keys set-registration vnd.anser-web-funds-transfer-initiation
pgp-signature set-registration-initiation vnd.audiograph
pidf+xml sgml vnd.blueice.multipass
675
Appendix H: MIME Media Types
59313bapp08.qxd:WroxPro 3/23/08 2:35 PM Page 675
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
vnd.bmi vnd.ecowin.chart vnd.fujitsu.oasysgp
vnd.businessobjects vnd.ecowin.filerequest vnd.fujitsu.oasysprs
vnd.canon-cpdl vnd.ecowin.fileupdate vnd.fujixerox.ddd
vnd.canon-lips vnd.ecowin.series vnd.fujixerox.docuworks
vnd.cinderella vnd.ecowin.seriesrequest vnd.fujixerox.docuworks.binder
vnd.claymore vnd.ecowin.seriesupdate vnd.fut-misnet
vnd.commerce-battelle vnd.enliven vnd.genomatix.tuxedo
vnd.commonspace vnd.epson.esf vnd.grafeq
vnd.cosmocaller vnd.epson.msf vnd.groove-account
vnd.contact.cmsg vnd.epson.quickanime vnd.groove-help
vnd.criticaltools.wbs+xml vnd.epson.salt vnd.groove-identity-message
vnd.ctc-posml vnd.epson.ssf vnd.groove-injector
vnd.cups-postscript vnd.ericsson.quickcall vnd.groove-tool-message
vnd.cups-raster vnd.eudora.data vnd.groove-tool-template
vnd.cups-raw vnd.fdf vnd.groove-vcard
vnd.curl vnd.ffsns vnd.hbci
vnd.cybank vnd.fints vnd.hhe.lesson-player
vnd.data-vision.rdz vnd.FloGraphIt vnd.hp-HPGL
vnd.dna vnd.framemaker vnd.hp-hpid
vnd.dpgraph vnd.fsc.weblaunch vnd.hp-hps

balance.desktop
vnd.Mobius.MSL
vnd.japannet-jpnstore-wakeup
vnd.llamagraphics.life-
balance.exchange+xml
vnd.Mobius.PLC
vnd.japannet-payment-wakeup
vnd.lotus-1-2-3 vnd.Mobius.TXF
vnd.japannet-registration vnd.lotus-approach vnd.mophun.application
vnd.japannet-registration-
wakeup
vnd.lotus-freelance vnd.mophun.certificate
677
Appendix H: MIME Media Types
59313bapp08.qxd:WroxPro 3/23/08 2:35 PM Page 677
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
vnd.motorola.flexsuite vnd.netfpx vnd.pvi.ptid1
vnd.motorola.flexsuite.adsi vnd.noblenet-directory vnd.pwg-multiplexed
[RFC3391]
vnd.motorola.flexsuite.fis vnd.noblenet-sealer vnd.pwg-xhtml-print+xml
vnd.motorola.flexsuite.gotap vnd.noblenet-web vnd.Quark.QuarkXPress
vnd.motorola.flexsuite.kmr vnd.novadigm.EDM vnd.rapid
vnd.motorola.flexsuite.ttc vnd.novadigm.EDX vnd.s3sms
vnd.motorola.flexsuite.wem vnd.novadigm.EXT vnd.sealed.doc
vnd.mozilla.xul+xml vnd.obn vnd.sealed.eml
vnd.ms-artgalry vnd.osa.netdeploy vnd.sealed.mht
vnd.ms-asf vnd.palm vnd.sealed.net
vnd.mseq vnd.paos.xml vnd.sealed.ppt
vnd.ms-excel vnd.pg.format vnd.sealed.xls
vnd.msign vnd.pg.osasli

vnd.uplanet.bearer-
choice-wbxml
vnd.wqd x-javascript
vnd.uplanet.cacheop vnd.wrq-hp3000-labelled x-msaccess
vnd.uplanet.cacheop-wbxml vnd.wt.stf x-msexcel
vnd.uplanet.channel vnd.wv.csp+xml x-mspowerpoint
vnd.uplanet.channel-wbxml vnd.wv.csp+wbxml x-rpm
vnd.uplanet.list vnd.wv.ssp+xml x-zip
vnd.uplanet.list-wbxml vnd.xara xhtml+xml
vnd.uplanet.listcmd vnd.xfdl xml
vnd.uplanet.listcmd-wbxml vnd.yamaha.hv-dic xml-dtd
vnd.uplanet.signal vnd.yamaha.hv-script xml-external-parsed-entity
vnd.vcx vnd.yamaha.hv-voice zip
679
Appendix H: MIME Media Types
59313bapp08.qxd:WroxPro 3/23/08 2:35 PM Page 679
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
59313bapp08.qxd:WroxPro 3/23/08 2:35 PM Page 680
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
I
Deprecated and
Browser-Specific Markup
As the versions of HTML and XHTML have developed, quite a lot of markup has been deprecated,
which means it has either already been removed from XHTML specifications or that it will be removed
in coming versions. While you will still be able to use much of this markup with Transitional XHTML,
Strict XHTML 1.0 has already removed most of the elements, attributes, and styles that you can read
about in this appendix.
I have included it in this book, despite the fact that the markup is deprecated or out-of-date, because
you are likely to come across it in other people’s code, and on very rare occasions you might need
to resort to some of it in order to get a specific job done (for example, if it has to work in very old

While you used to be able to browse the web only on desktop computers, lots of new devices are going
online, and these new devices are part of the reason why markup that describes the content of a document
(headings, paragraphs, and so on) has been separated from the presentation rules.
In older versions of HTML, before CSS was introduced, HTML contained markup that could be used to
control the presentation of a web page (such as the
<font>
element that would control the font used in a
document, or the
bgcolor
attribute that would set the background color of a page). The separation of style
from content and the introduction of CSS were the largest sources of deprecated markup.
Unfortunately, the older browsers that were built before CSS and other more recent markup simply will
not understand the newer ways of doing things, and if you ever have to create a web site for IE 3 or
Netscape 3 you will have to think very carefully about whether you use CSS (which they barely under-
stand, if at all) or whether you should use these deprecated elements and attributes. In reality, it is very
unlikely that you will have to create markup that would work in such an old browser; however, you
might need to understand how a page written back then works.
Older Pages Break Many Rules
You should be aware that a lot of the pages you see on the Web probably break a lot of the rules you have
learned in this book so far. You will see element and attribute names in upper- and lowercase, you will
see missing quotation marks on attribute values, even attributes without values, and you will see elements
that do not have closing tags. You will see pages without
DOCTYPE
declarations and pages littered with
deprecated markup. Keep in mind, however, that many of the pages that break the rules you have learned
might have been written when the rules were not as strict, and at the time of writing the code may have
been perfectly acceptable.
Even if a page with bad or deprecated markup renders fine in your browser, it’s still wise to avoid bad
habits at all costs; otherwise your pages will not be viewable by as many browsers in the future.
It is not just humans who wrote code that might be frowned upon these days. The early versions of author-

tags, one for each time you see the style of text change on the page.
The table that follows shows the three attributes the
<font>
element relies upon.
The following is an example of how the
<font>
element would have been used (
ai_eg01.html
). You
can see that there are three occurrences of the
<font>
element:
<html>
<head>
<title>Example of &lt;font&gt; Element</title>
</head>
<body>
<p>This is the browser’s default font.</p>
<font face=”arial, verdana, sans-serif” size=”2”>
<h1>Example of the &lt;font&gt; Element</h1>
Attribute Name Use Values
face
Specify the typeface that should
be used
Name of the typeface to use (can
include more than one name in
order of preference)
size
Specify the size of the font A number between 1 and 7 where 1
is the smallest font size and 7 is the

paragraph in this page. The element is not closed until just before the closing
<body>
tag, and therefore
the remainder of the document should be in an Arial typeface.
As you can see, the name of the Arial typeface is followed by the typeface Verdana; this is supposed to be
a second choice if Arial is not available. Then if Verdana is not available, the browser’s default sans-serif
font should be used:
<font face=”arial, verdana, sans-serif” size=”2”>
This
<font>
element also indicates that the default size of the text in the rest of the document should be
size 2. Note that this
<font>
element does not override the size of the
<h1>
element, but it does affect
the typeface used — the heading is written in Arial.
While this
<font>
element is acting as a default for most of the page, if you want a particular part of the
page to have any other font properties, you can indicate so in another
<font>
element.
You can see in the second paragraph that the color and size of font are changed to dark gray and size 4.
<p><font size=”4” color=”darkgray”>Here is some size 4 darkgray
writing</font></p>
684
Appendix I: Deprecated and Browser-Specific Markup
59313bapp09.qxd:WroxPro 3/23/08 3:04 PM Page 684
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.

<body>
element to indicate the default color for text in the document; it was
deprecated in HTML 4. Its value should be either a color name or a hex color. For example (
ai_eg03.html
):
<body text=”#999999”>
This text should be in a different color than the next bit
<font color=”#000000”>which is black</font>, and now back to gray.
</body>
You can see the result in Figure I-3.
Figure I-3
685
Appendix I: Deprecated and Browser-Specific Markup
59313bapp09.qxd:WroxPro 3/23/08 3:04 PM Page 685
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
The <basefont> Element
The
<basefont>
element is supposed to set a default font size, color, and typeface for any parts of the doc-
ument
that are not otherwise contained within a
<font>
element. You can then use the
<font>
elements
to override the
<basefont>
settings. However, this is not supported in Firefox or Netscape 6, and other
browsers do not always obey the settings in tables or headings.
The attributes that the

</html>
You can see the result in Figure I-4 shown in Internet Explorer (because the example does not work in
Firefox).
Figure I-4
686
Appendix I: Deprecated and Browser-Specific Markup
59313bapp09.qxd:WroxPro 3/23/08 3:04 PM Page 686
Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
As you can see, the default font now takes on the properties specified in the
<basefont>
element; it is
red, size 2, and uses the Arial typeface.
The paragraph after the
<h2>
element uses a font size four sizes larger than the default size and is gray
text, whereas the following paragraph uses a font one size smaller than the default font — you can also
see that the color of this font is black (overriding the default).
Because this element was deprecated in HTML 4, the preferred option is to use CSS styles attached to the
<body>
element to set default font properties for the document.
The <s> and <strike> Elements
Both the
<s>
and
<strike>
elements were added to HTML in version 3.2 and deprecated in version 4.
They indicate that their content should have a strikethrough style. For example (
ai_eg05.html
):
<s>This text will have a line through it</s>

The <listing>, <plaintext>, and <xmp> Elements
These three elements are all obsolete; they were introduced in HTML 2 and removed from HTML 4. They
are included here only because you may come across them in old examples.
All three elements display text in a monospaced font as the
<pre>
element does.
The
<xmp>
element was designed for a short snippet of example code, and cannot contain any other markup;
any characters such as angle brackets in element names get displayed as if they are text, so you do not need
to use escape characters for them. It is recommended that the author use a maximum limit of 80 characters
on any one line.
The
<listing>
element meanwhile has a recommended limit of 132 characters per line, and tends to
display text in a small font.
The
<plaintext>
tag indicates that anything following it should appear as plain text, even markup. Because
everything following the
<plaintext>
element is displayed as normal text, including tags, there is no
closing tag (if you tried to use a
</plaintext>
tag, it too would be displayed as normal text).
Here is an example of these three elements (
ai_eg07.html
):
<body>
<h2>Example of the &lt;listing&gt;, &lt;plaintext&gt;, and &lt;xmp&gt;


bgcolor
, which allowed you to specify a background color on the
<body>
and various table
elements

background
, which allowed you to specify a background image on the
<body>
element
The bgcolor Attribute
The
bgcolor
attribute allowed you to specify a background color for the whole document, or just part
of it. It could be used on the following elements:
<body> <table> <tr> <th> <td>
The value of the attribute should be a color name or hex color, as described in Appendix D.
The following is an example of a document using some different background colors (
ai_eg08.html
):
<html>
<head>
<title>Example of bgcolor Attribute</title>
</head>
<body bgcolor=”#efefef”>
<h2>Example of the bgcolor Attribute</h2>
<table bgcolor=”#999999”>
<tr>
<th bgcolor=”#cccccc”>Heading One</th>

The preferred method of changing background colors now is to use the
background-color
property in CSS.
The background Attribute
The
background
attribute allowed you to specify a background image for the whole page, and its value
should be the URL to the background image (which can be an absolute or relative URL). Netscape and
Microsoft also allowed this attribute to be used on tables to create a background image for the tables.
Here you can see an example of the
background
attribute being used (
ai_eg09.html
):
<html>
<head>
<title>Example of background Attribute</title>
</head>
<body background=”images/background_large.gif” bgcolor=”#f2f2f2”>
<h2>Example of the background Attribute</h2>
</body>
</html>
Note that the
bgcolor
attribute has also been used on the
<body>
element, which will be used if the image
cannot be found. You can see the result of this example in Figure I-9.
Figure I-9
690


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status