


The href attribute of the HTMLa tag specifies how to use relative paths and absolute paths
This time I will bring you the href attribute of the HTMLa tagSpecify the relative path and absolute path usage, use the href attribute of the HTMLa tag to specify the relative path and absolute path usageNotesWhat are they? The following is a practical case. Let’s take a look.
In actual Web development, insertingimages, including CSS files, etc. all require paths. If the file path is added incorrectly, it will cause the reference to become invalid (unable to Browsing linked files, or inserted pictures cannot be displayed, etc.). Many beginners are confused. Below I will introduce relative paths and absolute paths in detail.
HTML relative path refers to the path relationship with other files (or folders) caused by the path where this file is located.
For example:
文件1.htm的绝对路径是:d:/www/html/1.htm 文件2.htm的绝对路径是:d:/www/html/2.htm 那么:1.htm相对于2.htm的路径就是:1.htm
If you link to the same directory, you only need to enter the name of the document to be linked, for example:
<a href =”1 htm”>网页链接 </a> <img src=”bg.jpg” />
<a href =”html/ next.htm”> <img src=”images/bg.jpg” />
<a href = “../ www/index.htm”>
现在有4个html文件分别是aaa.html bbb.html ccc.html index.html aaa.html的路径为:D:/www/adminwang/html/aaa.html bbb.html的路径为:D:/www/adminwang/ bbb.html ccc.html的路径为:D:/www/ ccc.html index.html的路径为D:/www/ index.html
For example, ccc.html file link The code of index.html is as follows:
<a href="index.html">链接index网页</a>
For example, the code of bbb.
html link to ccc.html is as follows:
<a href="../ccc.html">链接ccc网页</a>
For example, the code for linking aaa.html to ccc.html is as follows:
<a href=”../../ccc.html”>链接ccc网页</a>
For example, ccc.html links to bbb.html The code is as follows:
<a href="adminwang/bbb.html">链接bbb网页</a>
For example, the code for ccc.html to link aaa.html is as follows:
<a href="adminwang/html/aaa.html">链接aaa网页</a>
Provide the file The full path to , including the applicable protocol or drive letter. That is, the real full path of the file or directory on your home page on the hard disk. For example:
http://www.adminwang.com/index.htm d:/ www /html/images/bg.jpg
Detailed explanation of examples of HTML text formatting
Summary of frequently used tags in html
The basics of HTML editing (a must-read for beginners)
The above is the detailed content of The href attribute of the HTMLa tag specifies how to use relative paths and absolute paths. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



src and href are respectively, 1. src is the abbreviation of source, which is used to specify the path of external resources. It is usually used to embed external files, such as pictures, audios, videos, etc. The src attribute is generally used on img, script, iframe and other tags. ; 2. href is the abbreviation of hypertext reference, which is used to specify the path of the target resource of the hyperlink. It is usually used to link to external documents or other pages. The href attribute is generally used on tags such as a and link.

MSVCP140D.dll is a very important resource file. If an error occurs when running the program that MSVCP140D.dll is not specified to run on Windows, then you need to take it seriously, because if you do not handle it properly, the program will not be able to run. MSVCP140D.dll is not specified to run on Windows. Solution: Method 1: First download the msvcp140.dll file, decompress it and copy it to the corresponding system directory (the different directory addresses below correspond to different systems and cannot be mistaken) 1. For Windows95/98/Me system, copy it to the C:\Windows\System directory. 2.Window

The src attribute and href attribute are commonly used attributes in HTML and are used to load external resources. Although they have similar purposes, there are some differences in usage and purpose. src attribute: The src attribute is used to specify external resources to be embedded in the document. It is mainly used to introduce external script files and media files into HTML documents. It can be used in the following situations: Introduce external JavaScript files: Link external JavaScript files to HTML pages through the src attribute.

Get requests sent by href and src. Detailed description: 1. The href attribute is used to specify the target resource of the link. When referencing an external style sheet, it will send a GET request to obtain the CSS file. When referencing the document, it will send a GET request to obtain the specified HTML file. When referencing an image, it will send a GET request. To obtain the specified image file; 2. The src attribute is used to specify the URL of the embedded resource. When referencing the image, it will send a GET request to obtain the specified image file. When referencing the audio, it will send a GET request to obtain the specified audio file, etc. .

The difference between src and href, details you must know! When writing HTML pages, we often encounter the two attributes src and href. They are both used to reference external resources, such as script files, style files, or images. Although their purposes are similar, there are some differences in their specific usage and details. First of all, the src (source) attribute is mainly used to embed external resources, such as pictures or scripts. It is used to specify the address of a resource and embed its content into the current document. And href(

What is the difference between src and href? Find out quickly! In the process of web development, src and href are two commonly used attributes. Although they look similar, they actually have different uses and applicable scenarios. In this article, we’ll dive into the differences between src and href and explain them with concrete code examples. In HTML, src is an attribute used to specify an external resource to be embedded or referenced. It is usually used to reference image, audio, video or script files. Unlike this, href is a hyperlink

When many friends are playing games, the system suddenly prompts that the program cannot be started because xlive.dll is missing from the computer. Try reinstalling this program to solve this problem. What's going on? It's because the file is missing or not registered. Let's take a look at the specific solutions below. xlive.dll is not specified to run in Windows Solution 1. Start-Run Enter CMD, click OK or press the Enter key on the keyboard to open the administrator command prompt window. 2. Copy: for%1in(%windir%\system32\*.dll)doregsvr32.exe/s%1 command, open the administrator command prompt

What are src attributes and href attributes? What's the difference between them? In HTML, the src attribute and the href attribute are two commonly used attributes for referencing external resources. Although they are somewhat similar in functionality, there are some differences in usage and types of referenced resources. First, let's take a look at the src attribute. src is the abbreviation of source, which is mainly used to specify the address of embedding/referencing external resources. It can be applied to some tags such as <script>, <img>
