(Figure 1)
2. Image link Image link means that the user can jump to other places by clicking on an image or part of the image on the web page. The tag for linking through images is <a href=URL><img src=></a>. Where the value of href can be a URL or a relative path, src can be a picture address. For example <a href=http://www.vevb.com><img src=http://www.vevb.com/images/logo.gif></a>, as shown in (Figure 2):
(Figure 2)
3. The target attribute of the hyperlink The target attribute specifies which type of window the linked file appears in. The format is: <a href=URL target=window-name>...</a>. If the value of target is equal to _blank, a new window will be opened after clicking the link to browse the target. If the target property is not used, the browser will browse the new HTML file in the original browser window after clicking on the link. For example, <a href=http://www.vevb.com target=_blank>VeVb</a>, click it and connect to my blog, as shown in (Figure 3):
(Figure 3)
4. Downloading files is the most common thing we do on the Internet. It is very simple to download through links. Just enter the location of the file at the link address. When the browser user clicks on the link, the browser will automatically determine the file type to handle it in different situations. Basic syntax: <a href=file_URL>Text link</a> Syntax explanation: file_URL represents the address of the file we want to download. You can write a relative path or an absolute path. Tip: Relative files refer to the path of other files under the same website, called relative paths, such as /news/default.html; and provide a complete path for the file, including the protocols used, such as http, ftp, etc., called absolute paths, such as http://www.baidu.com.
5. Script links can actually be linked through scripts, and can be used to implement functions that cannot be completed by HTML language. The following is to use JavaScript script language as an example to illustrate the use of script links. The various grammars of JavaScript will be discussed in the next chapter. Here I will give you a perceptual understanding of JavaScript. Basic syntax: <a href=JavaScript:...>Text link</a> Syntax explanation: The specific scripts are written after JavaScript:. For example, write a script link code for closing the window function: <html> <head> <title> Script link for closing the window function</title> </head> <body> <a href=JavaScript:window.close()>Close the window</a> </body> </html> After converting it into an HTML file, as shown in the figure (Figure 4). Click to close the window, and a dialog box prompting to close the exit will appear, such as (Figure 5):
(Figure 4)
(Figure 5)
6. Comprehensive use of hyperlinks. Let’s write a hyperlink with the target URL and email on the text, and set the image click to see the large image effect. Open the Notepad program and enter the following statement (see Figure 6 for the effect): <html> <head> <title> Example of using hyperlinks</title> </head> <body> <a href=http://www.vevb.com/images/logo.gif target=_blank> <img src=http://www.vevb.com/images/logo.gif src="/uploads/allimg/140624/131041DI-5.gif" />
(Figure 6)