.. / img/
Road strength is introduced in two ways: absolute positioning and relative positioning. The subject should use relative positioning, which is to find other files according to the current page. I guess your html page should be placed in the html folder. Suppose your html page is called a.html, then the path to img is.. / img/1.jpg. The subject can first go to the position of a.html and imagine what steps to go from a.html to 1.jpg. You need to go back to the previous level and open the img folder to find out if it is correct. Return to the previous level is.. /, enter the folder and enter the file name img. You'll know if you try it a few more times.
this may be familiar from the DOS era (after all, it is commonly used). Of course, you can also simulate it with cmd now.
Under the command line, when you use the dir
command to retrieve a directory, there are two special folders at the top of each directory:
.
..
the former represents the current directory and the latter represents the previous directory.
this can be used in cd
jump to the current (working) directory command, for example, you use cd.
to jump to the current directory, while cd..
is to jump to the next level directory. When writing the relative path, the same is true. First of all, you need to know the location of your current file, and then find the target file, such as yours, the html file is placed under the html folder, and the img is placed under the img folder, so if you want to find this img, you need to jump out of its own small directory (cut to the parent directory), and then jump into the img directory to find the corresponding file. Then you can write directly according to this idea, which is a path like .. / img/xxx.jpg
.
more nagging sentence, there is a path that starts with /
, which means to start looking from the root directory. For example, if you use a local file protocol, it may start with an address such as file:/
. The file://
in front is a protocol declaration, and the third line represents the absolute root path.
Previous: The rookie asked: how to understand the training in machine learning?
Next: How to change the value of a class property through a class method?
We are Mini Program s project. To get the code logged in by Wechat, request the backend api to get the sessionkey. But if it is a concurrent request, if it happens to expire at this time, and several requests go to get the sessionkey at the same time, t...
Mobile phone number input box, set to 6005 1078 to automatically add spaces question: [when you need to modify the number (6005), the cursor will jump to the end of the number immediately after deleting the number] demand: [after deleting the number, ...
I set the parent element to relative and the child element position to absolute positioning, but why does the font position change relative to the background when I zoom in and out? In the screenshot below, you can see the zoom in and out of the page, a...
at first I didn t write the CSS and HTML of the main area the following code is the sidebar CSS, page effect as shown in figure 2 main ...
using ionic, I want to write a tab switch, which can be regarded as secondary navigation. I got a component and wrote < ion-header > . < ion-navbar > <button ion-button icon-only menuToggle> <ion-icon name="menu">< ion-icon...
The responsive layout used in finds out how to get the height at the top of the browser by using the following methods on the mobile browser. Can t you use these in mobile browsers? my Orbon mobile browser document.body.scrollTop document.body.clientH...
has encountered a need to strictly distinguish the device information of users who visit the website (such as operating system, browser, etc.). Because there are some browsers that can disguise userAgent, I am afraid we cannot use userAgent to distinguis...
I want to make a music playback progress bar according to the music playback time, but ontimeupdate will get one card each time it updates the time. How can it increase the time smoothly? The following is an example from the rookie tutorial. The value o...
after trying onbeforeunload, I don t seem to be able to do it. Is there anything I can do about it? ...
...
there is usually a fixed process when developing a SPA like Vue, such as scaffolding to generate npm dependencies, then install dependencies, personalize Webpack configuration, jslint configuration, and then start writing components and so on. what ar...
Don t talk nonsense, look at the picture find a solution. ...
recently, the company is going to write WeChat Mini Programs, which is all written in the grammar of the original sound Mini Program. I recently heard that mpvue, is very popular, and decided to learn. I can want to write the original WeChat Mini Program...
what custom form plug-ins have you used? Like a lightning strike net? ...
because there is a loop, this.ip becomes undefined,. How to change the this to ...
set the minimum width of the div with min-width to center the div, but always inherit the width of the parent element, so that the content is always displayed on the left. How can you not inherit the width of the parent element ...
{ "type ": 3, "errorcode ": 0, "message ": "View Index " or its master view not found, or there is no location where the view engine supports search. Search the following locations: rn~ Areas SystemManage Views SystemHome Index.aspx rn~ Areas Syste...
There are multiple CheckBox, on the page. Select one to load a component and uncheck to delete a component. ? Select one to load one video, uncheck and delete one, and select a maximum of 9. The data given by the background CheckBox is uncertain. It ...
I npm installed quill rich text, local operation, display and function are normal. After packaging, after the dist is sent to the test server, the rich text will not be displayed, and the click will report an error. I don t know what the reason is. ...
...