Joshua von Damm
Joshua von Damm

Reputation: 43

Set path based on specific directory in HTML?

Let's say I am in

main/component1/index.html

and I want my html button to link me to main/component2/.

But the same index.html file is also used for the directory

main/component3/dir1/index.html

and I still want to link it to main/component2/.

Specifications:

How would I go about doing this? Thank you!

Upvotes: 0

Views: 276

Answers (1)

Milan
Milan

Reputation: 420

If I understood your question - no, you can't make it with HTML only, because HTML is not programing language, but markup language.

You can make relative and absoulte paths but not "variabled" paths.

Read more here:

https://stackoverflow.com/a/18321468/2719670

Upvotes: 1

Related Questions