I have several HTML documents in one folder locally. The pages link to eachother through hyperlinks. When I open a page in a browser the hyperlinks do not work and aren't even displayed in the developer tools. What is wrong?
JS
$('.only_css').removeAttr("href"); // I found this after putting the question sorry
HTML
<div class="label_css">
<a href="contact.html" class="only_css" target="_self">
<h3>Contact</h3>
</a>
</div>
Folder
contact.html
guestbook.html
index.html
Try to render on different browser
Try this:
Contact
Assuming that's literally the code you have. It is missing a ".
Something else in your code must be causing this behavior.
Check for unclosed parent/sibling elements, rogue Javascript, missing DOCTYPE, etc.
Related
How can I make <a href="/"> redirect to https://[username].github.io/[repo] instead of https://[username].github.io/ with github pages?
When serving my multi-page html website, I get a 404 - Not Found every time I click on an <a href="/"> link on my pages. Instead of redirecting to https://mepley.github.io/github-pages-redirect-to-index/ where index.html is found, I am instead redirected to https://mepley.github.io/ and thus I get the 404 - Not Found message.
Here is a link to a github pages site to demonstrate the issue (served from master branch):
https://mepley.github.io/github-pages-redirect-to-index/
My end goal is to simply use <a href="/"> from another html document and redirect back to index.html. IMPORTANT: I DO NOT want to settle for any other strategy, such as <a href="/index.html"> or <a href="./"> or <a href="../"> as relative references.
The reason I'm adamant about using just "/" is because I'm creating a boilerplate webpack configuration for building static websites for first-time, beginning coders to deploy a simple website to github pages and I'd prefer not having to explain this idiosyncrasy to people who are just learning and are already confused to begin with.
I've tried using <base href="https://mepley.github.io/github-pages-redirect-to-index"> tags, but this did not fix the issue. I tried other <base> tags as well, to no avail (but maybe I did something wrong?). And as explained in my comment below I also know that relative references from the current page (i.e. <a href="../">) will in fact redirect to the correct homepage, but it still DOES NOT answer my question, unfortunately.
Here are the only two files needed to demonstrate this issue:
index.html
<!DOCTYPE html>
<html>
<body>
This is index.html
goto another-page.html
</body>
</html>
another-page.html
<!DOCTYPE html>
<html>
<body>
This is another-page.html
go back to index.html
</body>
</html>
Expected result is that I click on the <a href="/"> link in another-page.html and it redirects me back to https://mepley.github.io/github-pages-redirect-to-index/ and finds index.html instead of https://mepley.github.io/ with the 404 error as is currently happening.
Any help on this issue would be greatly appreciated!
Also, here is the repo link for the site: https://github.com/mepley/github-pages-redirect-to-index
The best solution is what you did not want to do:
<a href="/index.html"/>.
Please explain why you do not want to do that. It’s only 10 extra characters.
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
I'm using jykell to create a personal website. Check it out here chrisCPO.com general feedback is welcome. Still a wip.
UPDATE: looks like some of the site root vars are not being rendered on added pages. Home link code is:
<a href="{{ site.baseurl }}">
which works but is being overridden on the additional page?
If you visit the site notice click on experience on the sidebar.Then try to go to the home page.
Issue is if I add a page like the docs say to I get all of my added pages in-site links are broken. They are rendering as
<a class="sidebar-nav-item" href="">Home</a>
instead of
<a class="sidebar-nav-item" href="/">Home</a>
notice the href.
note: both of these issues are on production only, everything works fine locally.
What is the correct way to add an additional page so everything works?
using jekyll 3.0
You need to set your CSS paths in your layout relative to the root of the site, like this: /css/style.css (notice the first slash). Then the choice for folders or no folders becomes irrelevant. Permalinks can be managed globally in the config file. See the docs.
I have a simple problem with my <a href=""> code: they don't open anymore...
It only worked one time, and then no more.
I don't know why... It would be great if someone can help me with this.
my code:
<div data-role="page" id="p1">
<div data-role="header" data-theme="a" data-position="fixed" data-id="footer">
Home
</div
I tried a lot of things, but I didn't find out what the problem is.
It looks like you are experiencing a combination of broken paths and jQuery Mobile's overriding of link behavior.
On the first load you are in the folder containing the sub-folder Destaque, after you click on it your reference directory is Destaque so clicking on it again would try and resolve Destaque/Destaque/Destaque.html. This behavior might not look like a a classic 404 because of jQuery Mobile (it uses ajax to load pages).
To fix this use an absolute path by adding a leading / changing this:
Home
to this:
Home
This assumes that this sub-folder is in fact in the root of your web app. If not then you need to adjust your absolute path.
Ok. i have find the answer for this problem.
the path i have written was right and the problem was not the relative/absolute path.
the only thing i have to add to this link is rel="external", because the html page that i want to open is in the sub-folder from my projecto.
the following code show the right code for this situation.
Home
When I try link a ext Url such as www.facebook.com it currently comes as -
mysite.com/music/www.facebook.com
Its linked: <a href="www.facebook.com></a> as i link internal urls like <a href=./index.html> etc etc
How to make it work?
I assume you're talking about in HTML. You need the full URL, e.g. http://www.example.com, not just www.example.com.
Try adding an http:// prefix to your URLs: http://stackoverflow.com/faq
You might find the HTML 4.01 specification interesting reading. (Probably not. But pay attention to the 12.4.1 Relative URIs section at the bottom of the page. :)