Home > Web Front-end > HTML Tutorial > Summary of a tag-img tag-absolute/relative path example tutorial

Summary of a tag-img tag-absolute/relative path example tutorial

零下一度
Release: 2017-06-24 11:54:35
Original
1574 people have browsed it

Wonderful Saturday, I will write more today and try to write js as soon as possible. This is a bit boring.

1. Let’s first talk about jumping between web pages

 (1)、 href="Here is the address of the web page to jump to"; Jump between two pages, or jump to other web pages directly through the URL.

Web page code: We write two web pages and jump between them

<html>
    <head>
        <title>网页一</title>
    </head>
    <body>
     <a href="网页2.html">跳转网页2</a>
    </body>
</html>
Copy after login

Web page two code:
<html>
    <head>
        <title>网页二</title>
    </head>
    <body>
     <a href="网页1.html">跳转网页1</a>
    </body>
</html>
Copy after login

The two files must be in the same folder. [Note]: It is best to name the page in English. If it is in Chinese, it may be later. There is a problem, I am just here to let everyone understand a little bit more

[Note]: Here the two files are at the same level, and when they jump like this Yes, what if they are not at the same level!

It’s like this! What about the path in our "href=' '" if web page 2 is in another folder? Of course, look at the picture.

Webpage 1 Jump to Webpage 2

# #In fact, we often see it when we go online, so what does this mean? What this means here is based on the current file, which is "

Webpage 1

", which means jumping to

Webpage 2# under the subfolder . ##中文;But the problem comes again, I want to Webpage 2 Jump to Webpage 1 What should I do if I go to this? Here we will introduce a little thing

../

This represents Return to the previous level folder Isn’t the previous level of web page 2 the subfolder ! Isn’t the web page at the same level as the subfolder web page 1!

So The code for webpage 2 to jump to webpage 1 is like this

This means It means that he jumps to web page 1 in the previous folder

1. Relative path

This kind of path is called a relative path, which means relative With the current file, where is the file you are looking for? Of course, we have another one, which is absolute path but it is not recommended.

Relative paths can be used on anyone’s computer, but absolute paths cannot. Who knows where you will put the file. 2. Absolute path

I will teach you how to get the absolute path. Drag the file into the browser address bar and the complete address of the file will be displayed.

  Just the one after the drive letter! File:/// in front is not required

 You can also jump by writing the complete address in web page 2

 

Finally, here’s something Little thing, yesterday I talked about inserting pictures into web pages

##1. Inserting pictures

##  (1),

##
<html>
     <head>
	<title>插入图片</title>
     </head>
     <body>
	<img src="img/01.jpg">
     </body>
</html>
Copy after login

(2) Path [Note]: Since my files are placed like this, my pictures are the pictures in the img folder of the html folder The picture named 01.jpg. Also note here that the format path format of your image is different from the image format and it cannot be displayed!

Effect

I hope everyone will comment more!

The above is the detailed content of Summary of a tag-img tag-absolute/relative path example tutorial. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template