Absolute path URL and relative path URL in html and subdirectory, parent directory, root directory

Absolute path URL and relative path URL in html and subdirectory, parent directory, root directory
An absolute URL is used to represent all the content required for a specific file on the Internet. Every file on the Internet has a unique URL, which is the link that needs to be entered into the address bar when searching on a web page.

For example, to access a Baidu webpage, just enter http://www.baidu.com./ in the webpage address bar.

Once you enter a web page, when you click on other screens within it, you will notice that the link in the address bar may become very long. This is because the address of the content you clicked will use a relative URL. Relative URLs are only suitable for other directories under the web page link with the same name, and will be invalid if they enter other websites. If you want to connect to a resource in the same directory, you only need to change the file name, and the original address does not need to be changed.

1. Subdirectories

The subdirectories in the computer are easy to understand. For example, C:\ is the parent directory, C:\Windows is the subdirectory of C:\; C:\Windows\System32\ is the subdirectory of C:\Windows.

Each level of subdirectory only needs to add a slash / after the parent directory and then add the file name to form a subdirectory.

2. Parent Directory

Parent directory: This is the same as C:\Windows\System32\ in 1. C:\Windows is the parent directory of System32.

3. Root Directory

Root directory: The example is the same as above, that is, C:/ is the root directory.

The same is true for the directory in HTML. The only difference is that the root directory needs to be changed to this format: architecture + server address + file name.

Example:

http://www.wrox.com/index.html;

<<:  JavaScript flow control (loop)

>>:  Detailed explanation of the solution to image deformation under flex layout

Recommend

4 ways to avoid duplicate insertion of data in Mysql

The most common way is to set a primary key or un...

WeChat applet implements video player sending bullet screen

This article shares the specific code for WeChat ...

Linux loading vmlinux debugging

Loading kernel symbols using gdb arm-eabi-gdb out...

How to create a table in mysql and add field comments

Directly post code and examples #Write comments w...

Detailed explanation of MySQL database binlog cleanup command

Overview Today I will mainly share how to correct...

Detailed explanation of Vue project packaging

Table of contents 1. Related configuration Case 1...

How to dynamically add a volume to a running Docker container

Someone asked me before whether it is possible to...

Solve the problem of ifconfig being unavailable in docker

Recently, when I was learning docker, I found tha...

Three ways to communicate between React components (simple and easy to use)

Table of contents 1. Parent-child component commu...

Solution to Ubuntu not being able to connect to the Internet

Problem description: I used a desktop computer an...

How to configure Linux CentOS to run scripts regularly

Many times we want the server to run a script reg...

Vue3+script setup+ts+Vite+Volar project

Table of contents Create a vue + ts project using...

Introduction to network drivers for Linux devices

Wired network: Ethernet Wireless network: 4G, wif...