Ask coding questions

← Back to all posts
How to add links to inside pages
h
cuber1515

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 [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100

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

cuber1515
Coder100

np
mark as correct answer? @cuber1515

Xenity

As @xfinnbar said, use an <a> tag. Here's how: html <a href="example.com" <!-- 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

@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.

Xenity
cuber1515

thank you @Xenity

Xenity
xfinnbar
cuber1515

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

Coder100

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

cuber1515

ohh, thank you @Coder100

Coder100