In actual Web development, inserting images, including CSS files, etc. all require a path. If the file path is added incorrectly, the reference will become invalid (unable to browse the linked file, or unable to display the inserted image, etc.). Many beginners are confused. Below I will introduce relative paths and absolute paths in detail. HTML relative path How to use relative links: XML/HTML CodeCopy content to clipboard
If you want to link to the next level directory, you need to enter the directory name first, then add "/", and then enter the file name, for example: XML/HTML CodeCopy content to clipboard
If you want to connect to the upper-level directory, you need to enter "../" first, and then enter the directory name and file name, for example: XML/HTML CodeCopy content to clipboard
Example summary 1. Link files in the same directory XML/HTML CodeCopy content to clipboard
XML/HTML CodeCopy content to clipboard
XML/HTML CodeCopy content to clipboard
XML/HTML CodeCopy content to clipboard
XML/HTML CodeCopy content to clipboard
HTML absolute path |
<<: Sample code for implementing horizontal infinite scrolling with pure CSS3
>>: 25 Ways and Tips to Increase Web Page Loading Speed
Original article: Ultimate IE6 Cheatsheet: How To...
The Swap partition of the Linux system, that is, ...
The original code is this: <div class='con...
Table of contents 1. Development Environment 2. I...
In general, MySQL provides a variety of storage e...
To do MySQL performance adjustment and service st...
Docker-compose deploys gitlab 1. Install Docker I...
Due to the advantages of GTID, we need to change ...
Table of contents Overview CommonJS Specification...
Web front-end optimization best practices: conten...
Table of contents 1. Decoupled assignment of arra...
Use "onInput(event)" to detect whether ...
Table of contents Difference between MVC and MVVM...
There is no solution for Chinese input method und...
In the path of using nginx as a reverse proxy tom...