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

Sample code for implementing multi-application deployment using tomcat+nginx

Table of contents Multi-application deployment 1-...

Why do we need Map when we already have Object in JavaScript?

Table of contents 1. Don’t treat objects as Maps ...

Several ways to use require/import keywords to import local images in v-for loop

Table of contents Problem Description Method 1 (b...

VMware12.0 installation Ubuntu14.04 LTS tutorial

I have installed various images under virtual mac...

Example of implementing load balancing with Nginx+SpringBoot

Introduction to Load Balancing Before introducing...

A brief discussion on value transfer between Vue components (including Vuex)

Table of contents From father to son: Son to Fath...

A brief discussion on browser compatibility issues in JavaScript

Browser compatibility is the most important part ...

Detailed explanation of Angular component projection

Table of contents Overview 1. Simple Example 1. U...

Implementing a web calculator with native JavaScript

This article shares the specific code of JavaScri...

Tutorial on installing Pycharm and Ipython on Ubuntu 16.04/18.04

Under Ubuntu 18.04 1. sudo apt install python ins...

Implementation steps for enabling docker remote service link on cloud centos

Here we introduce the centos server with docker i...

Getting Started with MySQL - Concepts

1. What is it? MySQL is the most popular relation...

SQL insert into statement writing method explanation

Method 1: INSERT INTO t1(field1,field2) VALUE(v00...

Vue handwriting loading animation project

When the page is not responding, displaying the l...