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

The concept of MySQL tablespace fragmentation and solutions to related problems

Table of contents background What is tablespace f...

How to set the memory size of Docker tomcat

When installing Tomcat in Docker, Tomcat may over...

CentOS 7 configuration Tomcat9+MySQL solution

Configure Tomcat First install Tomcat Installing ...

Summary of event handling in Vue.js front-end framework

1. v-on event monitoring To listen to DOM events,...

A detailed discussion of evaluation strategies in JavaScript

Table of contents A chestnut to cover it Paramete...

Summary of several replication methods for MySQL master-slave replication

Asynchronous replication MySQL replication is asy...

How to install MySQL 8.0.13 in Alibaba Cloud CentOS 7

1. Download the MySQL installation package (there...

How to query data from multiple unrelated tables and paging in Mysql

Mysql multiple unrelated tables query data and pa...

Detailed explanation of Vue's live broadcast function

Recently, the company happened to be doing live b...

Three implementation methods of Mysql copy table and grant analysis

How to quickly copy a table First, create a table...

A brief explanation of the reasonable application of table and div in page design

At the beginning of this article, I would like to ...

A brief discussion on three methods of asynchronous replication in MySQL 8.0

In this experiment, we configure MySQL standard a...

How to use axios request in Vue project

Table of contents 1. Installation 2. There is no ...

Specific use of the autoindex module in the Nginx Http module series

The main function of the brower module is to dete...

Introduction and tips for using the interactive visualization JS library gojs

Table of contents 1. Introduction to gojs 2. Gojs...