当我制作原型时,我应该在 href 中添加什么?

发布于 2024-09-03 04:23:00 字数 287 浏览 4 评论 0原文

在原型设计时,我们经常做空锚点。一种非常常见的方法是执行以下操作:

<a href="#">Go here</a>

但是如果客户端单击此链接,页面将滚动到顶部。但如果我们省略 href 属性,链接的行为就不会像链接一样。

我见过这样的东西:

<a href="javascript;">Go here</a>

但它看起来不对。

还有其他想法吗?

When protyping we often do empty anchors. A very common way to do this is to do something like:

<a href="#">Go here</a>

But if the client clicks this link, the page will scroll to the top. But if we leave out the href attribute, the link won't behave like a link.

I've see stuff like:

<a href="javascript;">Go here</a>

But it doesn't look right.

Any other ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

终陌 2024-09-10 04:23:00
<a href="javascript:void(0);">Go here</a>

当您点击它时不会执行任何操作。我认为“标准”是只使用 # 并告诉客户它是原型,因此链接将无法正常运行:)

<a href="javascript:void(0);">Go here</a>

will do nothing when you click on it. i think the 'standard' is to just use a # though and tell the client that it's a prototype and so links will not function properly :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文