In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the knowledge of "how to quote html absolute path and relative path". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. The role of.\ (a higher level of directory)
In html.. / represents the directory at the next level, that is, the directory above the directory where the html file is located
If you want to refer to the upper two-level directory, you can..
II. References to sibling directories
If the referenced file and the referenced file are in the same level directory, you can write directly. If the above file is in the same level directory, you can write\ jquery-1.3.1.js directly.
The style defined in the stylesheet file after html references the external stylesheet is not equal to the style defined in the html header file, it is still stored in the defined file and downloaded to the client, so the relative path in the external stylesheet is relative to the path to change the stylesheet, not to the path of the html that references the stylesheet.
If you are writing html or css or js by hand, it is recommended to use relative paths, such as.. /.. / css/main.css.
If it is a dynamic file, such as jsp, php, etc., it is best to use the absolute path of the website. such as
{ctx} / resources/main.css, where ctx is a self-defined variable whose value is equal to an address like http://localhost.
Disadvantages of the relative path: for example:.. / images/zollty.png, this way of writing, once I change the directory where the page file is referenced, this picture will not be displayed. If you change to the absolute path of the site {ctx} / images/zollty.png, then no matter how I move the referenced page file, as long as the address of the image remains the same, it can be accessed.
The disadvantage of absolute path: for static files, it is often impossible to automatically get the root path of the site ({ctx}), so it is troublesome to write absolute path.
"how to quote html absolute path and relative path" content is introduced here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.