Đang chuẩn bị liên kết để tải về tài liệu:
Learning Web Design Third Edition- P13
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Learning Web Design Third Edition- P13:Everything you need to know to create professional web sites is right here. Learning Web Design starts from the beginning defining how the Web and web pages work and builds from there. By the end of the book, you'll have the skills to create multi-column CSS layouts with optimized graphic files, and you'll know how to get your pages up on the Web. | Linking Within Your Own Site NOTE Linking to another spot on the same page works well for long scrolling pages but the effect may be lost on a short web page. Linking to a specific point in a page Did you know you can link to a specific point in a web page This is useful for providing shortcuts to information at the bottom of a long scrolling page or for getting back to the top of a page with just one click. You will sometimes hear linking to a specific point in the page referred to as linking to a document fragment. Linking to a particular spot within a page is a two-part process. First you identify the destination and then you make a link to it. In the following example I create an alphabetical index at the top of the page that links down to each alphabetical section of a glossary page Figure 6-11 . When users click on the letter H they ll jump down on the page to the H heading lower on the page. Step 1 Naming the destination AUTHORING TIP To the Top It is common practice to add a link back up to the top of the page when linking into a long page of text. This alleviates the need to scroll back after every link. I like to think of this step as planting a flag in the document so I can get back to it easily. To create a destination use the id attribute to give the target element in the document a unique name that s unique as in the name may only appear once in the document not unique as in funky and interesting . In web lingo this is the fragment identifier. You may remember the id attribute from Chapter 5 Marking Up Text where we used it to name generic div and span elements. Here we re going to use it to name an element so that it can serve as a fragment identifier that is the destination of a link. Here is a sample of the source for the glossary page. Because I want users to be able to link directly to the H heading I ll add the id attribute to it and give it the value startH Figure 6-11 O . h1 id startH H h1 NOTE Remember that id values must start with a letter