Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Linking and Publishing Basic Web Pages Chapter 3 XHTML Introductory 1 Objectives In this chapter, you will: • Link Web pages • Study Uniform Resource Locators (URLs) • Create absolute and relative links • Create links within the same Web page • Learn how to publish your Web pages • Study metadata XHTML Introductory 2 Linking Web Pages • You activate a hypertext link by clicking it with your mouse button • A hypertext link in an HTML document is underlined and often displayed in a vivid color • The text or image used to represent a link on a Web page is called an anchor • You create a basic hypertext link using the <a> element (the a stands for anchor) XHTML Introductory 3 Linking Web Pages XHTML Introductory 4 Linking Web Pages • It is not always necessary to use images for links because basic text links, if properly placed on a Web page, can be just as effective • It takes much less time to create a text-based hyperlink than it does to design an image to use as a hyperlink XHTML Introductory 5 Uniform Resource Locators • Hypertext Transfer Protocol (HTTP) – manages the hypertext links that are used to navigate the Web – ensures that Web browsers correctly process and display the various types of information contained in Web pages (text, graphics, audio, and so on) • The protocol portion of a URL is followed by a colon, two forward slashes, and a host • A host refers to a computer system that is being accessed by a remote computer • The host portion of a URL is usually www for “World Wide Web” XHTML Introductory 6 Uniform Resource Locators • Domain name – a unique address used for identifying a computer, often a Web server, on the Internet – consists of two parts separated by a period – The first part of a domain name is usually text that easily identifies a person or an organization, such as DonGosselin or Course – The last part of a domain name, known as the domain identifier, identifies the type of institution or organization – Common domain identifiers include .biz, .com, .edu, .info, .net, .org, .gov, .mil, or .int XHTML Introductory 7 Uniform Resource Locators XHTML Introductory 8 Absolute and Relative Links • An absolute URL refers to the full Web address of a Web page or to a specific drive and directory • A relative URL specifies the location of a file relative to the location of the currently loaded Web page XHTML Introductory 9 Linking Within the Same Web Page • Bookmarks are internal links within the current document and can be a particularly effective tool for helping users navigate through a long Web page • You create bookmark links by using the id attribute • The standard id attribute uniquely identifies an individual element in a document • Any element that includes an id attribute can be the target of a link XHTML Introductory 10 Linking Within the Same Web Page • The id attribute replaces the name attribute that is used in HTML • Many older browsers do not recognize the id attribute • To address this problem the name attribute was not deprecated in the <a> element • To ensure that your links are valid in older browsers, you must use both the id and name attributes inside an <a> element and assign the same value to both attributes XHTML Introductory 11 Publishing Your Web Pages • Web hosting refers to the publication of a Web site for public access • You can use your own computer to host your Web site, provided it is connected to the Internet • Although you may have a state-of-the art desktop computer, it will probably still be slower than a professional-strength Web server, which is a special type of computer used for hosting Web sites XHTML Introductory 12 Publishing Your Web Pages • Most people use an Internet Service Provider (ISP) to host their Web sites • An ISP provides access to the Internet along with other types of services including e-mail • Most ISPs have extremely fast Internet connections using advanced fiber-optic connections that are light years more powerful than a dial-up modem • ISPs also have very large and powerful Web servers, along with the expertise and manpower to maintain and manage them XHTML Introductory 13 Domain Name Registration • One important decision you need to make is what to use for a domain name • To find out the availability of a domain name and register it, you must contact a domain name registrar • Domain names are stored in a master database that is maintained by InterNIC, the organization responsible for the registration of domain names and IP addresses XHTML Introductory 14 Domain Name Registration • A popular domain name registrar is Network Solutions, a division of VeriSign • Once you register your domain name, you need to notify your ISP of your domain information • Usually, it is easier to register your domain name through the ISP you intend to use because they can automatically handle the details of setting up the domain for you XHTML Introductory 15 File Transfer Protocol • File Transfer Protocol (FTP) is the protocol used for transferring files across the Internet • A Web browser is not the target for files transferred by FTP • FTP simply transfers files between an FTP client (your computer) and an FTP server (a server capable of running FTP) XHTML Introductory 16 File Transfer Protocol • To publish your Web site, you must upload your files to your ISP’s FTP server • Your ISP will give you a user name and password that you must use to log into the FTP site • Various types of commercial shareware software exist that you can use to access an FTP site • Many HTML Editors such as FrontPage have built-in commands that you can use to log into an FTP server and upload your files XHTML Introductory 17 File Transfer Protocol XHTML Introductory 18 Advertising Your Web Site • Web directories are listings of Web sites that have been compiled by humans • Search engines use software to “crawl” or “spider” their way through the Web and automatically compile an index of Web sites • Yahoo! is an example of a Web directory that is compiled by humans, whereas HotBot is an example of a search engine that finds Web sites automatically XHTML Introductory 19 Advertising Your Web Site • Waiting for search engines and directories to come to you is not the best way of advertising your site • Your best bet is to submit your site to a search engine or Web directory when you first publish it or whenever you make major changes to it • Most search engines and directories have a button that allows you to submit a site XHTML Introductory 20 Advertising Your Web Site • Directories such as Yahoo! that are compiled by humans require that you include a description of your Web site when you submit it • In comparison, to find information about a Web site, a search engine’s “spider” (also called a “crawler” or “robot”) will visit a page on the site, record information about the page in an index, and then follow any links to other pages within the site and index their information XHTML Introductory 21 Metadata • The term metadata means information about information • In a Web page, you use the <meta> element to provide information to search engines and Web servers about the information in your Web page • You must place the <meta> element within the <head> element • You can use three primary attributes with the <meta> element: name, content, and http-equiv XHTML Introductory 22 The name Attribute • You use the name attribute to define the name of the information you want to provide about the Web page • You can use any text you like as the value of the name attribute XHTML Introductory 23 The name Attribute • Two values that are used by some search engines are description and keyword – Many search engines create a description of a Web page based on the first 200 characters following the opening <body> tag, unless the Web page includes a description <meta> element – Keywords are the words that describe the type of Web page a user is looking for and will likely type into a Web directory or search engine XHTML Introductory 24 Hiding Web Pages from Search Engines • Your Web site may includes pages that you do not want to be included in any search engine indexes • For instance, you may have a page that stores personal information or private data that, although not private enough to encrypt using special security software or a protocol such as HTTPS, should not be returned to a user who performs a search in a search engine XHTML Introductory 25 Hiding Web Pages from Search Engines • You can inform search engine spiders that you do not want certain pages on your site to be indexed by placing a file named robots.tx in the root directory of the Web server that hosts your Web site • This technique is called the Robots Exclusion Protocol XHTML Introductory 26 The http-equiv Attribute • When a user wants to access a Web page, either by entering its URL in a browser’s Address box or by clicking a link, the user’s Web browser asks the Web server for the Web page in what is referred to as a request • What the Web server returns to the user is called the response • One part of the response is the requested Web page XHTML Introductory 27 The http-equiv Attribute • The response header is sent to the Web browser before the Web page is sent in order to provide information that the browser needs to render the page • One of the most important pieces of information in the response header is the type of data, or contenttype, that the server is sending • One important use of the <meta> element is to specify a document’s character encoding • The W3C strongly encourages the use of contenttype <meta> elements to specify an XHTML document’s character set XHTML Introductory 28 Summary • The text or image used to represent a link on a Web page is called an anchor • Hypertext Transfer Protocol (HTTP) manages the hypertext links that are used to navigate the Web • A host refers to a computer system that is being accessed by a remote computer • An absolute Uniform Resource Locator (URL) refers to the full Web address of a Web page or to a specific drive and directory XHTML Introductory 29 Summary • A relative URL specifies the location of a file relative to the location of the currently loaded Web page • Web hosting refers to the publication of a Web site for public access • Domain names are stored in a master database that is maintained by InterNIC, the organization responsible for the registration of domain names and Internet Protocol (IP) addresses XHTML Introductory 30 Summary • File Transfer Protocol (FTP) is the protocol used for transferring files across the Internet • Search engines use software to “crawl” or “spider” their way through the Web and automatically compile an index of Web sites • You use the <meta> element to provide information to search engines and Web servers about the information in your Web page XHTML Introductory 31