Web Programming with HTML, XHTML, and CSS- P15

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

lượt xem

Web Programming with HTML, XHTML, and CSS- P15

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

Web Programming with HTML, XHTML, and CSS- P15: There are a lot of books about designing and building web pages, so thank you for picking up this one. Why do I think it is different? Well, the Web has been around for over a decade now, and during its life many technologies have been introduced to help you create web pages, some of which have lasted, others of which have disappeared. Many books that teach you to write web pages are revisions of earlier versions of the same book and therefore still take the same approach as the previous edition did....

Chủ đề:

Nội dung Text: Web Programming with HTML, XHTML, and CSS- P15

  1. Appendix H: MIME Media Types 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 image 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
  2. Appendix H: MIME Media Types multipar t alternative form-data report appledouble header-set signed byteranges mixed voice-message digest parallel encrypted related audio 32kadpcm G726-24 MP4A-LATM AMR G726-32 mpa-robust AMR-WB G726-40 mpeg basic G728 mpeg4-generic CN G729 parityfec DAT12 G729D PCMA dsr-es201108 G729E PCMU DVI4 GSM prs.sid EVRC GSM-EFR QCELP EVRC0 L8 RED EVRC-QCP L16 SMV G722 L20 SMV0 G.722.1 L24 SMV-QCP G723 LPC telephone-event G726-16 MPA tone 672
  3. Appendix H: MIME Media Types 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 x-wav audio/qcelp vnd.lucent.voice vnd.rhetorex.32kadpcm video BMPEG MP4V-ES vnd.mpegurl BT656 MPV vnd.nokia.interleaved-multimedia CelB mpeg vnd.objectvideo DV mpeg4-generic vnd.sealed.mpeg1 H261 nv vnd.sealed.mpeg4 H263 parityfec vnd.sealed.swf H263-1998 pointer vnd.sealedmedia.softseal.mov H263-2000 quicktime vnd.vivo JPEG SMPTE292M x-sgi-movie MP1S vnd.fvt x-msvideo MP2P vnd.motorola.video MP2T vnd.motorola.videop 673
  4. Appendix H: MIME Media Types message CPIM http s-http delivery-status news sip disposition-notification partial sipfrag external-body rfc822 model iges vnd.gdl vnd.parasolid.transmit.binary mesh vnd.gs-gdl vnd.parasolid.transmit.text vnd.dwf vnd.gtw vnd.vtu vnd.flatland.3dml vnd.mts vrml 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 674
  5. Appendix H: MIME Media Types index.vnd pkcs10 sgml-open-catalog iotp pkcs7-mime sieve ipp pkcs7-signature slate isup pkix-cert timestamp-query mac-binhex40 pkixcmp timestamp-reply macwriteii pkix-crl tve-trigger marc pkix-pkipath vemmi mathematica postscript vnd.3gpp.pic-bw-large mpeg4-generic prs.alvestrand.titrax-sheet vnd.3gpp.pic-bw-small msword prs.cww vnd.3gpp.pic-bw-var news-message-id prs.nprend vnd.3gpp.sms news-transmission prs.plucker vnd.3M.Post-it-Notes ocsp-request qsig vnd.accpac.simply.aso ocsp-response reginfo+xml vnd.accpac.simply.imp octet-stream remote-printing vnd.acucobol oda riscos vnd.acucorp ogg rtf vnd.adobe.xfdf 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 Continued 675
  6. Appendix H: MIME Media Types 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 vnd.dreamfactory vnd.fujitsu.oasys vnd.hp-PCL vnd.dxr vnd.fujitsu.oasys2 vnd.hp-PCLXL vnd.ecdis-update vnd.fujitsu.oasys3 vnd.httphone 676
  7. Appendix H: MIME Media Types vnd.hzn-3d-crossword vnd.japannet-setstore-wakeup vnd.lotus-notes vnd.ibm.afplinedata vnd.japannet-verification vnd.lotus-organizer vnd.ibm.electronic-media vnd.japannet-verification- vnd.lotus-screencam wakeup vnd.ibm.MiniPay vnd.jisp vnd.lotus-wordpro vnd.ibm.modcap vnd.kde.karbon vnd.mcd vnd.ibm.rights-management vnd.kde.kchart vnd.mediastation.cdkey vnd.ibm.secure-container vnd.kde.kformula vnd.meridian-slingshot vnd.informix-visionary vnd.kde.kivio vnd.micrografx.flo vnd.intercon.formnet vnd.kde.kontour vnd.micrografx.igx vnd.intertrust.digibox vnd.kde.kpresenter vnd.mif vnd.intertrust.nncp vnd.kde.kspread vnd.minisoft-hp3000-save vnd.intu.qbo vnd.kde.kword vnd.mitsubishi.misty-guard .trustweb vnd.intu.qfx vnd.kenameaapp vnd.Mobius.DAF vnd.ipunplugged.rcprofile vnd.kidspiration vnd.Mobius.DIS vnd.irepository.package+xml vnd.koan vnd.Mobius.MBK vnd.is-xpr vnd.liberty-request+xml vnd.Mobius.MQY vnd.japannet-directory- vnd.llamagraphics.life- vnd.Mobius.MSL service balance.desktop vnd.japannet-jpnstore-wakeup vnd.llamagraphics.life- vnd.Mobius.PLC balance.exchange+xml vnd.japannet-payment-wakeup vnd.lotus-1-2-3 vnd.Mobius.TXF vnd.japannet-registration vnd.lotus-approach vnd.mophun.application vnd.japannet-registration- vnd.lotus-freelance vnd.mophun.certificate wakeup Continued 677
  8. Appendix H: MIME Media Types 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.sealedmedia.softseal.html vnd.ms-lrm vnd.picsel vnd.sealedmedia.softseal.pdf vnd.ms-powerpoint vnd.powerbuilder6 vnd.seemail vnd.ms-project vnd.powerbuilder6-s vnd.shana.informed.formdata vnd.ms-tnef vnd.powerbuilder7 vnd.shana.informed .formtemplate vnd.ms-works vnd.powerbuilder7-s vnd.shana.informed .interchange vnd.ms-wpl vnd.powerbuilder75 vnd.shana.informed.package vnd.musician vnd.powerbuilder75-s vnd.smaf vnd.music-niff vnd.previewsystems.box vnd.sss-cod vnd.nervana vnd.publishare-delta-tree vnd.sss-dtf 678
  9. Appendix H: MIME Media Types vnd.sss-ntf vnd.vectorworks vnd.yamaha.smaf-audio vnd.street-stream vnd.vidsoft.vidconference vnd.yamaha.smaf-phrase vnd.svd vnd.visio vnd.yellowriver-custom-menu vnd.swiftview-ics vnd.visionary watcherinfo+xml vnd.triscape.mxs vnd.vividence.scriptfile whoispp-query vnd.trueapp vnd.vsf whoispp-response vnd.truedoc vnd.wap.sic wita vnd.ufdl vnd.wap.slc wordperfect5.1 vnd.uiq.theme vnd.wap.wbxml x400-bp vnd.uplanet.alert vnd.wap.wmlc x-debian-package vnd.uplanet.alert-wbxml vnd.wap.wmlscriptc x-gzip vnd.uplanet.bearer-choice vnd.webturbo x-java vnd.uplanet.bearer- vnd.wqd x-javascript choice-wbxml 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
  10. I Deprecated and Browser-Specific Mar kup 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 browsers such as IE 3 and Netscape 3), and some of these browsers will not support what you want to do with CSS. In addition to deprecated markup, you will also see some of the browser-specific markup that you may well come across. This is markup that Microsoft or Netscape (and in some cases both companies) added to its browsers to allow users to do more things than its competitors — but these elements and attributes never made it into the HTML recommendations, and are therefore referred to as browser-specific markup. So not only does this appendix help you deal with markup you come across that has been deprecated, but you might also use some techniques to get the result you want. This appendix covers the following: ❑ Elements and attributes that have been deprecated in recent versions of HTML and XHTML ❑ Specifying font appearances without using CSS ❑ Controlling backgrounds without using CSS ❑ Controlling presentations of links, lists, and tables without using CSS ❑ Elements and attributes that control the formatting of a document ❑ Elements, attributes, and styles that Microsoft added to IE (but that are not supported by other browser manufacturers) ❑ Elements, attributes, and styles that Netscape added to Navigator (but that are not supported by other browser manufacturers)
  11. Appendix I: Deprecated and Browser-Specific Markup Before you look at any of this markup, however, a quick word on why a good part of an appendix is deprecated markup. Why Deprecated Mar kup Exists In the first chapter, I explained how XHTML 1.0 was created after its predecessor (HTML) had reached version 4.01. With each version of HTML, new elements and attributes are added or old ones removed. These changes have been necessary, not only because web page authors have wanted to create increasingly complicated pages, but also because the types of browsers (also known as clients) accessing the Internet have changed. 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 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- ing tools such as Microsoft FrontPage and Macromedia Dreamweaver sometimes generated code that had strange capitalization or missing quotation marks, and featured attributes without values. This certainly does not make it okay to follow their lead. The first versions of these programs were written before XHTML came along with its stricter rules (which were discussed in Chapter 1). Older browsers are very forgiving of code that is not written correctly and have been designed to render a page anyway. But that is one of 682
  12. Appendix I: Deprecated and Browser-Specific Markup the main reasons why browsers have been increasing in size — future browsers will not necessarily be so forgiving. You have been warned that this appendix will contain some odd things, but if you remember to stick to the principles you have learned in this book (and don’t miss quotes, attribute values, and closing elements or follow the bad habits others have) your pages will be available for many more people and your skills will be more marketable. Fonts In this section, you learn about several elements (and their attributes) that affect the appearance of text and fonts, all of which have been deprecated. The Element The element was introduced in HTML 3.2 and deprecated in HTML 4.0, but is still widely used today. It allows you to indicate the typeface, size, and color of font the browser should display between the opening and closing tags. You could probably find many sites littered with tags, one for each time you see the style of text change on the page. The table that follows shows the three attributes the element relies upon. Attribute Name Use Values face Specify the typeface that should Name of the typeface to use (can be used 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 largest font size color Specify the color of the font A color name or hex value (see Appendix D) The following is an example of how the element would have been used (ai_eg01.html). You can see that there are three occurrences of the element: Example of <font> Element This is the browser’s default font. Example of the <font> Element 683
  13. Appendix I: Deprecated and Browser-Specific Markup Here is some size 3 writing in the color called darkgray. The typeface is determined by the previous <font> element that contains this paragraph. Now here is a courier font, size 2, in back The result of this example is shown in Figure I-1. Figure I-1 As you can see from Figure I-1, all the writing within a element follows the rules laid down in the attributes of the opening tag. The first paragraph is in the browser’s default font (which is prob- ably a size 3 Times family font in black). The first element appears directly after this paragraph, and contains the rest of the page. This first element acts like a default setting for all but the first paragraph in this page. The element is not closed until just before the closing 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: This element also indicates that the default size of the text in the rest of the document should be size 2. Note that this element does not override the size of the element, but it does affect the typeface used — the heading is written in Arial. While this 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 element. You can see in the second paragraph that the color and size of font are changed to dark gray and size 4. Here is some size 4 darkgray writing 684
  14. Appendix I: Deprecated and Browser-Specific Markup The third paragraph then uses a different typeface, a smaller size, and black: Now here is a courier font, size 2, in back Note that you may have to use elements inside and elements, as the styles specified outside tables are not inherited by the text inside cells. Figure I-2 shows you the different font sizes from 1 to 7 (ai_eg02.html). Figure I-2 Font sizes can change slightly from browser to browser, so you cannot rely on them to be exactly the same number of pixels tall or wide in a layout. The preferred method with CSS would be to use the font-family, font-size, and color properties on the element containing the text that you wanted to style. You learned about these CSS properties in Chapter 7. The text Attribute The text attribute is used on the 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): This text should be in a different color than the next bit which is black, and now back to gray. You can see the result in Figure I-3. Figure I-3 685
  15. Appendix I: Deprecated and Browser-Specific Markup The Element The 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 element. You can then use the elements to override the 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 element takes are exactly the same as for the element, which you’ve just seen. And again, elements such as the heading elements will retain their own size. You can also set the size of fonts relative to the size of the by giving them a value of +1 for a size larger or -2 for two sizes smaller (on the same scale from 1 to 7). You can see these effects by revisiting the last example, and making some changes — the changes are highlighted (ai_eg04.html): Example of <basefont> Element This is the page’s default font. Example of the <basefont> Element Here is some darkgray text four sizes larger Here is a courier font, a size smaller, in black 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
  16. Appendix I: Deprecated and Browser-Specific Markup As you can see, the default font now takes on the properties specified in the element; it is red, size 2, and uses the Arial typeface. The paragraph after the 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 element to set default font properties for the document. The and Elements Both the and 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): This text will have a line through it This text will also have a line through it. You can see the results in Figure I-5. Figure I-5 You should now use the text-decoration property in CSS, with a value of strikethrough, unless you are trying to indicate deleted content, in which case you should use the element. The Element The element renders its content underlined. It was introduced in HTML 3.2 and deprecated in version 4. This text should be underlined. You can see the effect in Figure I-6. Figure I-6 687
  17. Appendix I: Deprecated and Browser-Specific Markup You should now use the text-decoration property in CSS with a value of underline unless you are trying to indicate added content (when a document has been revised), in which case you should use the element. The , , and 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 element does. The 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 element meanwhile has a recommended limit of 132 characters per line, and tends to display text in a small font. The tag indicates that anything following it should appear as plain text, even markup. Because everything following the element is displayed as normal text, including tags, there is no closing tag (if you tried to use a tag, it too would be displayed as normal text). Here is an example of these three elements (ai_eg07.html): Example of the <listing>, <plaintext>, and <xmp> Elements These words are written inside a <listing> element. These words are written inside an element. These words are written inside a element. You can see the result in Figure I-7. Note how the escape characters in the element are ignored and not escaped (this could also contain angle brackets and they would display normally). You will also see the clos- ing and tags because anything after the opening tag is treated as plain text: Figure I-7 688
  18. Appendix I: Deprecated and Browser-Specific Markup The replacements in XHTML are and . Backgrounds There were two attributes in HTML that would allow you to change the background of a whole page or part of it: ❑ bgcolor, which allowed you to specify a background color on the and various table elements ❑ background, which allowed you to specify a background image on the 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: 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): Example of bgcolor Attribute Example of the bgcolor Attribute Heading One Heading Two Cell One Cell Two Cell Three Cell Four You can see this page in Figure I-8. 689
  19. Appendix I: Deprecated and Browser-Specific Markup Figure I-8 The page has a very light gray background color specified on the element. The table then has a background color, which you can see on the bottom row and all around the edges of the table. This is the default color for the table. Then you can see that the bgcolor attribute is used both on the element (the table headings) and the following element in the first row. 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): Example of background Attribute Example of the background Attribute Note that the bgcolor attribute has also been used on the 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
Đồng bộ tài khoản