Xem mẫu

  • Madrigals
    • This Sweet and Merry Month of May
    • Though Amaryllis Dance
    • Lullabye, My Sweet Little Baby
  • Masses
    • Mass for Five Voices
    • Mass for Four Voices
    • Mass for Three Voices
  • Motets
    • Ave verum corpus a 4

See Also Madrigals, Masses, Motets

You`ll need to create an anchor at the section heading for Byrd. You then can link to that anchor from the See Alsos in the file for M. As I described earlier today, you need two elements for each anchor: an anchor name and the text inside the link to hold that anchor (which might be highlighted in some browsers). The latter is easy; the section heading itself works well because it`s the element to which you`re actually linking. You can choose any name you want for the anchor, but each anchor in the page must be unique. (If you have two or more anchors with the name fred in the same page, how would the browser know which one to choose when a link to that anchor is selected?) A good, unique anchor name for this example is simply byrd because byrd can appear only one place in the file, and this is it. After you`ve decided on the two parts, you can create the anchor itself in your HTML file. Add the tag to the William Byrd section heading, but be careful here. If you were working with normal text within a paragraph, you`d just surround the whole line with . But when you`re adding an anchor to a big section of text that`s also contained within an elementsuch as a heading or paragraphalways put the anchor inside the element. In other words, enter

Byrd, William, 1543-1623

but do not enter

Byrd, William, 1543-1623

file:///G|/1/0672328860/ch05lev1sec4.html (5 von 8) [19.12.2006 13:48:40] The second example can confuse your browser. Is it an anchor, formatted just like the text before it, with mysteriously placed heading tags? Or is it a heading that also happens to be an anchor? If you use the right code in your HTML file, with the anchor inside the heading, you avoid the confusion. The easiest answer is probably just putting the anchor ahead of the heading tag, like this:

Byrd, William, 1543-1623

If you`re still confused, refer to Appendix B, "HTML 4.01 Quick Reference," which has a summary of all the HTML tags and rules for which tags can and cannot go inside each one. So, you`ve added your anchor to the heading and its name is "byrd". Now go back to the See Also line in your m.html file:

See Also Byrd, Gibbons, Lassus, Monteverdi, Morley, Weelkes, Wilbye

You`re going to create your link here around the word Byrd, just as you would for any other link. But what`s the URL? As you learned previously, pathnames to anchors look similar to the following: page_name#anchor_name If you`re creating a link to the b.html page itself, the HRef is as follows: Because you`re linking to a section inside that page, add the anchor name to link that section so that it looks like this: Note the small b in byrd. Anchor names and links are case sensitive; if you put #Byrd in your href, the link might not work properly. Make sure that the anchor name you use in the name attribute and the anchor name in the link after the # are identical. Caution A common mistake is to put a hash sign in both the anchor name and in the link to that anchor. You use the hash sign only to separate the page and the anchor in the link. Anchor names should never have hash signs in them. file:///G|/1/0672328860/ch05lev1sec4.html (6 von 8) [19.12.2006 13:48:40] So, with the new link to the new section, the See Also line looks like this:

See Also Byrd, Gibbons, Lassus, Monteverdi, Morley, Weelkes, Wilbye

Of course, you can go ahead and add anchors and links to the other parts of the reference for the remaining composers. With all your links and anchors in place, test everything. Figure 5.13 shows the Madrigals section with the link to Byrd ready to be selected. Figure 5.13. The Madrigals section with a link to Byrd. [View full size image] Figure 5.14 shows the screen that pops up when you select the Byrd link. You may need to reduce the size of your browser window to see how the link to the anchor takes you to the correct spot on the page. Figure 5.14. The Byrd section. [View full size image] file:///G|/1/0672328860/ch05lev1sec4.html (7 von 8) [19.12.2006 13:48:40] Linking to Anchors in the Same Document What if you have only one large page, and you want to link to sections within that page? You can use anchors for it, too. For larger pages, using anchors can be an easy way to jump around within sections. To link to sections, you just need to set up your anchors at each section the way you usually do. Then, when you link to those anchors, leave off the name of the page itself, but include the hash sign and the name of the anchor. So, if you`re linking to an anchor name called section5 in the same page as the link, the link looks like the following: Go to The Fifth Section When you leave off the page name, the browser assumes that you`re linking with the current page and scrolls to the appropriate section. You`ll get a chance to see this feature in action in Lesson 6. There, you`ll create a complete web page that includes a table of contents at the beginning. From this table of contents, the reader can jump to different sections in the same web page. The table of contents includes links to each section heading. In turn, other links at the end of each section enable the user to jump back to the table of contents or to the top of the page. file:///G|/1/0672328860/ch05lev1sec4.html (8 von 8) [19.12.2006 13:48:40] file:///G|/1/0672328860/ch05lev1sec5.html [19.12.2006 13:48:40] ... - tailieumienphi.vn
nguon tai.lieu . vn