开发者

Can I stop a link looking like a link?

开发者 https://www.devze.com 2023-03-19 05:20 出处:网络
I disabled my address link with the following: <a href=\"#\" onclick=\"return false;\" rel=\"nofollow\">Overview</a>

I disabled my address link with the following:

<a href="#" onclick="return false;" rel="nofollow">Overview</a>

This came from some suggestions in my last post.

However --- When I move the cursor over the link a hand appears to show it's a link even though it does no开发者_如何学编程thing. Is there a way to stop the cursor changing to a hand?

Thanks,


Through CSS, a { cursor: default; color: black; text-decoration:none; }

This will remove the blue text, underline and the hand pointer that is normally default for browsers. Also, why are you using a tags, haha?


If your link isn't pointing anywhere, you could just remove the href from the tag, which will result in browsers rendering the link as just normal text. (no underline, no pointer cursor)


Yes, there is a styling rule to affect this. It is called the cursor property. Just apply a rule like this to your link styles:

cursor: default;


Change the cursor to cursor:default;, e.g.

<a href="#">Link 1</a>
<a href="#" style="cursor:default;">Link 2</a>

Link 2 will use the default arrow cursor.

0

精彩评论

暂无评论...
验证码 换一张
取 消