How to link back out of a folder using the a-href tag? Last Updated : 15 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Introduction: Whenever we make a project it is generally distributed among various folders. That is generally done to improve the connectivity and readability for the various web developers working on the same project. For example: The above classification is just an example but the classification can be bigger. So if you have to call an image from the image folder for the home page or want to call a page in article form the home page it would be a direct URL ie. "Images/gfg.jpg" or "Other Pages/Articles/Gfg Article1.html". But if you have to call an image from the image folder for the Gfg Article1 page then the general URL will not work. You have to use a relative file path. To learn more about the relative path please follow this article. Example 1: It shows the path of the file present in a folder above the folder of the current web page file. The image file present in a folder called images and current web page file exists inside a subfolder, then the code will be as follows: html <!DOCTYPE html> <html> <head> <title>Relative file path</title> </head> <body> <h2>File present in a folder above the current folder</h2> <img src="../images/gfg.jpg" alt="My Image" style="width:200px"> </body> </html> Output: Example 2: It shows the path of the file present in a folder which is located at the root of the current subdirectories. html <!DOCTYPE html> <html> <head> <title>Relative file path</title> </head> <body> <h2>File present in a folder which is located at<br> the root of the current subdirectories</h2> <img src="/images/picture.jpg" alt="My Image" style="width:200px"> </body> </html> Output: Comment More info A aditya_taparia Follow Improve Article Tags : Web Technologies HTML HTML-Basics Explore HTML BasicsHTML Introduction5 min readHTML Editors5 min readHTML Basics7 min readStructure & ElementsHTML Elements5 min readHTML Attributes8 min readHTML Headings4 min readHTML Paragraphs5 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists5 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks3 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables10 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics6 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like