href link to nowhere - html

I've got a hover effect under "Latest Playlists"
https://phuzz.superhi.com/
but would like to make the link unclickable or not to go anywhere.
I've tried the return false and couple of other options but it just makes the page scroll to the top and reload?
This is what I've got at the moment:
<em>2.</em><i> INTO THE FIRE BY SUCK</i> <img src="rs-13160-102513-black-flag-623-1382724540.jpg">
Thanks!

If you don't want it clickable, don't use <a> anchor in the first place.
Use <span></span> tag instead.

Please add below code in href=" ".
href="javascript:void(0);"
This is work for me. Please try it.

Related

How can I create link that does nothing?

I want to create a link that does NOTHING, it means that its a fake link
Im trying with onclick="mijava();return false;" but it scrolls up in the website
How can I do it?
javascript:
document.getElementById("nothing").addEventListener("click", function(event){
event.preventDefault()
});
html:
<a id="nothing" href="#">Link</a>
JSFiddle
"javascript:void(0)" to href attribute, the <a> tag will do nothing.
This won't do anything.
Link
Do you test it that?
link
You can use CSS to style it like a link and you probably don't want to use an anchor tag if it's not going to act like one.
See this answer: How to make an anchor tag refer to nothing?

Links redirecting to "#"

I'm trying to create a menu on a website, and it keeps redirecting to the page I'm creating no matter what I put in the href tags. I can't figure out what's causing it, I figured maybe another set of eyes could help me figure it out.
https://gist.github.com/b3f3abc42c517c8ba7ab
EDIT: fixed link
it is
file
and not
<a href src="http://adammcgee.com/clients/sdaysrodeo/file.html">file</a>
the attribute src is used with
<img>
for example
<img src="image.gif">
the address you give us for you gist is bad.
it is not
https://gist.github.com/b3f3abc42c517c8ba7ab.git
but
https://gist.github.com/b3f3abc42c517c8ba7ab
without "git" at the end
then the only link I found in your menu is not correct.
it is
<a href src="http://adammcgee.com/clients/sdaysrodeo/sdays-rodeo/announcer/#">PRCA</a>
it should nor finish by a "#" and you should have the extension of the page, like :
http://adammcgee.com/clients/sdaysrodeo/sdays-rodeo/announcer/page.html

how to make anchor link so it goes to div of external html page

How I can give anchor link for a div of external file. For example I am in home page, now I want to go to div with id name "Electronics" in products.html page.
I have tried with doing some thing like
<a href="products.html#Electronics" />
But it is not working properly. If some one know alternative way please let me know.
Thanks in advance.
Your URL should like this..
Link
in your case it should be
<a href="products.html/#Electronics" />
I hope it helps you
DEMO: http://jsfiddle.net/ZRLB5/

Use anchor tag for calling an Action

First I tried with
<input type="button" value="Something" onclick="location.href='#Url.Action("ActionName")'" />
But this is a button and I want just a link. I've seen somewhere (while wildly browsing the programming forums) a way to hide a button link behind an anchor, but couldn't find/make it.
Then I tried with
(here, actually, on the page, the link looked like Something">, whereas the " and > shouldn't be there)
and also
Something
but the latter 2 ways (with the anchor tag) don't work, by means, I don't get directed to the other page. So, any suggestions about how to hide a button behind a link, or how to make the anchor tags run ?
You want an anchor, but the suggested code doesn't work. Try this way (it worked for me):
<a onclick="location.href='#Url.Action("ActionName")'">Something</a><br />
It will work this way, but you will not have the hand, when you hover the link. So just add href="#", like that:
Something<br />
Use #Html.ActionLink("Something", "ActionName", "ControllerName") without the <a> tag. It's generated automatically
<a asp-action="Index">Location Name</a>

HTML div navigation

I`ve seen on various websites, some links appear like this: http://www.myserver.com/page.html#something and when I click on it, it just moves to another portion of the page.
I want to know how to do this. Is it only the URL of the <a href> atrribute?
The fragment at the end of the url coresponds to an ID on the page you're visiting.
If in my page I have a section such as:
<div id="comments">
...
</div>
Then I can take the user to this section by attaching #comments to the pages URL
(http://www.example.com/page.html#comments)
Link to comments
Update
Some of the other answers here correctly point out that you can create an anchor with a name attribute as: <a name="example"></a>.
Although this is technically correct, it's also a very antiquated way of doing things and something I'd recommend you avoid. It's very 1997 as some might say :-)
The text after the hashtag corresponts with an anchor on the page. An anchor is a hidden element on the page which you can link to.
Think for example about a large page with an to top link in it
To create an anchor use:
<a name="C4"></a>
To link to it use: Text
Or you can even link to an id of an element
Check out: links (aka anchors)
Also note that you can use <a name="something"></a> or <a id="something"></a>
or using divs <div id="something"></div>
This is a link to a bookmark on the given page (or even just #something on the current page).
To make it work, you need to define something. You can do this using the name attribute of an <a> tag.
http://programming.top54u.com/post/HTML-Anchor-Bookmark-Tag-Links.aspx