Elon Musk fan
Elon Musk fan

Reputation: 3

Is there a way to use a href in Text Edit to other documents?

I started using TextEdit for writing html, and when I try to use a href to link to other documents, it says "No webpage was found for the web address: file:///Users/user/Documents/“file:///Users/user/Documents/helloWorld.htmlâ€". the document I am linking to is called helloWorld, so I am pretty sure it is not a typo. What can I do to fix the error? Here is the code so far:

<!DOCTYPE html>
<html>
<head>
<title>About Hello World</title>
</head>
<body>
<p>About hello World</p>
<a href=‘file:///Users/user/Documents/helloWorld.html'>Home</a>
</body>
</html>

Upvotes: 0

Views: 2228

Answers (2)

aqua959
aqua959

Reputation: 99

If you are using a Mac, you could run terminal, find the file you want to link to, and drag it to terminal. It will show the directory of the file and you could copy&paste it to the href tag.

Upvotes: 0

C. McCarthy
C. McCarthy

Reputation: 102

Give it a try by spesifying the whole path to the other file, such as

<a href="file:///C:/Users/user/Documents/helloWorld.html">

Or if it was in your F drive then

<a href="file:///F:/Users/user/Documents/helloWorld.html">

However keep in mind, if you are going to be sharing this page with other people of course they are most probably not going to have access to the same file path as you. So the file will not be displayed.

Upvotes: 1

Related Questions