Why does my link say unable to find file? - html

I am working on a project and am making an anchor tag link to another page (just another page on the website). Yet when I do this, it says, "Your file was not found". What could be wrong? Here is what my anchor tags look like
<a id="mission-link" class="link" href=".../Home/index.html#mission">
Thanks for the help and have a great day

You are using 3 dots instead of 2
.../Home/index.html#mission
should be
../Home/index.html#mission
If that still doesn't fix it, then we'd need to know your folder structure to know whether you should actually be moving up a directory or not. .. moves up a directory from where the current file is.

Related

How to link to html in a folder not directly connected

I am creating a website with simple HTML+CSS. How do I create a hyperlink (href) in an HTML file, to an HTML file in a folder, that is not directly related.
See picture. If I want to insert a link in HTML 4 to HTML 3.
I know one can use ..\HTML2.html to go back in parent folder, but what is the best way here?
Typing / points to the relative root directory. So you can just do HTML 3 and it should take you to HTML3.
You can also use HTML 3 as you seem to know.
General recommendation would be to pick the closest path. If it's from the root, then select the first. If it's from a relative point from where you are, then the second.
Considering your drawing, I assume that node 1 is the root so the simplest way would be: .\html3.html

html image will work on one page but not another

Im using Atom to do some homework, I am a beginner at html this is my first assignment and I am trying to make my first page, however I am having problems getting my images to show up. I got them to show up on a previous page and now I have moved on to a different page and tried to use the same and it won't show up, I even tested it on another page and it works on there, I don't understand what im missing can someone please steer me in the right direction.
img tags have a property named src. this prop should fill with path of your image. if you use absolute path, it should started with '/'.
imagine that you have a directory named 'public' and a file named 'image.png' in that directory. you can use img tag like this:
<img src="/public/image.png"/>
keep in mind that start slash is referred to the base directory of your project.
to check the path, you can inspect in your html file. open your html file in your browser. right click and select inspect (or you can press F12 and go to inspector tab if you are using firefox or chrome).
find the <img {...}/> element and check it's src prop and path url. keep in mind that the path should open the image. if that's not happening, there is a problem with your path.

html anchor to download file from another server

As I have searched, making a download link is like
<a href="image_url.png" download>download</a>
But the image must be in project directory. How to download from another server?
For example if I want to download django logo the code is supposed to be:
<a href="https://www.djangoproject.com/s/img/logo-django.42234b631760.svg" download>download</a>
but that's not working (it opens and shows the image in the current tab instead of downloading), but any file in my own server is being downloaded easily. What is the best way to do that? tnx
You simply need to put name of the file (how it should be saved) in download. Like this:
download
Edit:
Actually I was wrong. You can find the answer here. If you want to download SVG in regular way, like any other file, you need to use JavaScript, not just plain HTML tags. Or you can download it as PNG, but as I assume: that's not the point.
Sorry for mistake.
you put link in href on anchor tag:
download

How to go to a certain point of a different document in a .md file?

I am trying to go to a second part in the below mentioned .md file.
The file is Myfile.md.
its contents are:
## First part
(an image)
## Second part
(an image)
I am trying to access it from a html file by using the command
Second part.
However, it is not pointing to the second part but pointing somewhere below that.
Can anyone tell me how to correct it?
Experimenting, I found a solution using <div…/> but an obvious solution is to place your own anchor point in the page wherever you like, thus:
<a name="abcde"/>
before and
</a>
after the line you want to 'link' to. Then a markdown link like:
[link text](#abcde)
anywhere in the document takes you there.
The <div…/> solution inserts a "dummy" division just to add the id property, and this is potentially disruptive to the page structure, but the <a name="abcde"/> solution ought to be quite innocuous.
(PS: It might be OK to put the anchor in the line you wish to link to, as follows:
## <a name="head1"/>Heading One</a>
Please refer another question : How to link to part of the same document in Markdown?

HTML Links are adding an extra path in the href

I am currently designing a small website using JSP / Servlets. Tomcat is very picky about my routes.
My application can be entered throught the path /Final (on a localhost I have http://localhost:8088/Final).
My main JSP page is at http://localhost:8088/index.jsp. On that page, I have a navbar with several links. On one of those links, the "Home" link, I have the href set to /Final/index.jsp. When I hover over the link, it shows the links path as http://localhost:8088/Final/Final/index.jsp.
At first, I said ok, lets just change the href to index.jsp, but when I do that, the link now points to http://localhost:8088/index.jsp which will not satisfy the server. Why are links behaving like this? How can I get it to point to http://localhost:8088/Final/index.jsp without fully qualifying it?
You could use a relative path such as pointing it directly to it's location. I'm not sure if this would work, but try putting /index.jsp as the href in your link. This way it's going from your current folder "Final" and going one level down to index.jsp.
Apparently, adding the . before the path as in ./index.jsp works just fine.
Also, you can try to escape your file and specify it again, it worked for me.
For example: ../jsp/index.html