同页锚链接 (#) 可以有多长?

发布于 2024-09-03 20:48:17 字数 543 浏览 7 评论 0原文

IE6以上主流平台浏览器同页锚标签链接最大字符数是多少?

例如,像这样的链接:

http://example.com/#a789c4d8ecb0ec2201444bfa64b04696aa2bbaa41eb331535d1dd6d219558a02968d5af97ae74359973163337ef9b09c65dd70d40c3c79a4169355ea92db45e21fe30550dce4987987237652a347b97759f2753b412ee50d4121d0f6382580b5a62d1e02921c39c252c5e4731e38fc295ad6abcb22613513c4fd7599ab10d3f9c970b9eb3ddf5b2cf233af25005298590ce798b28092cecdc6756c8205e9a0650826e42a184267d0bfb5e3d7b3d1c25e324fe6329cf7681ffae7c01c86d4a70

请注意上面的 # 符号。

请注意,我正在使用 XHTML 过渡(如果这很重要的话)。

What is the maximum number of characters that a same-page anchor tag link can be on all mainstream platform browsers released from IE6 on up?

For instance, a link like:

http://example.com/#a789c4d8ecb0ec2201444bfa64b04696aa2bbaa41eb331535d1dd6d219558a02968d5af97ae74359973163337ef9b09c65dd70d40c3c79a4169355ea92db45e21fe30550dce4987987237652a347b97759f2753b412ee50d4121d0f6382580b5a62d1e02921c39c252c5e4731e38fc295ad6abcb22613513c4fd7599ab10d3f9c970b9eb3ddf5b2cf233af25005298590ce798b28092cecdc6756c8205e9a0650826e42a184267d0bfb5e3d7b3d1c25e324fe6329cf7681ffae7c01c86d4a70

Note the # symbol above.

Note I'm using XHTML transitional, if that matters any.

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

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

发布评论

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

评论(1

似最初 2024-09-10 20:48:17

更好的问题是“我的网址可以有多长?”

不幸的是,我们必须构建最薄弱的链接,即 Internet Explorer,它将 URL 限制为大约 2000 个字符。

因此,您可以在锚标记上使用的最大长度为:
锚点长度 = 2000 - (网址大小)

The better question is "how long can my url be?"

Unfortunately, we must build to the weakest link, internet explorer, which limits the url to about 2000 characters.

So, the max length you can use on an anchor tag would be:
length of anchor = 2000 - (size of url)

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