Open In App

How to make an HTML link to open a folder ?

Last Updated : 18 Jun, 2025
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

To create a link to a file or folder, you need to use an <a href > tag. HTML can be used to open a folder from our local storage. To open a folder from our local storage, use the 'href' attribute of HTML. In the href attribute, we specify the path of our folder.

Syntax:

<a href="Path"></a>

Examples to open local folders using HTML

Example 1: Implementation to show how to make an HTML link to open a folder.

html
<!DOCTYPE html>
<html>

<head>
    <title>HTML link to open a folder</title>
</head>

<body>
    <h1>Opening a folder from HTML code</h1>
    <a href="file:///C:/path/to/your/folder" target="_blank">Click to open the folder</a>

</body>
</html>

Output:

kio

Example 2: Implementation to show how to make an HTML link to open a folder.

html
<!DOCTYPE html> 
<html> 
<head> 
    <title>Sample Code</title> 
</head> 
  
<body> 
    <h1>Opening a folder from HTML code</h1> 
    <a href="C:\Users\ABC\Desktop\cpp"> 
        Click to open a folder 
    </a> 
</body> 
</html> 

Output:

kio




How to make an HTML link to open a folder ?

Similar Reads