Ask coding questions

← Back to all posts
How to add links to inside pages
cuber1515 (55)

How to add links to inside pages (HTML, CSS, JavaScript)

So I've noticed that when I look at the code from other people who post a website, that a lot of times they add a file (name.html), then they add a link in the website to that page so that you don't have to make a whole new repl.

How do you do this?

Answered by Coder100 (18057) [earned 5 cycles]
View Answer
Coder100 (18057)
<a href="name.html">link!</a>

don't forget to make the name.html file too.

Xenity (9)

As @xfinnbar said, use an <a> tag. Here's how: html <a href="" <!-- if you want to use the link to run javascript, change href to onclick and in the "" put in your function's name (example: <a onclick="myfunction();">Link Text</a>) --> >what you want the text of your link to be</a>

cuber1515 (55)

@Xenity What I'm trying to ask is if I add another .html file how do I find the link to that page bc I know how to do links but I can't open any other page other than the main .html page so I can't find the URL.

cuber1515 (55)

@xfinnbar yes but how do you find the link to the inside page.

Coder100 (18057)

it's just the file name.
If it's inside a folder, do <foldername>/<name>.html@cuber1515