程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]?

开发过程中遇到在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]的问题如何解决?下面主要结合日常开发的经验,给出你关于在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]的解决方法建议,希望对你解决在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]有所启发或帮助;

我是网站开发的新手。我的问题是导航栏从来没有我点击导航栏只是主页,关于,服务,如果我点击导航栏中的联系方式到那个时候到 URL 设置请我的问题这个 #[object%20Object] 看不懂请帮帮我

<li><a href="#welcome">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#service">service</a></li>
<li><a href="#contact-us">Contact</a></li>

Same page link IDs used

<div ID="welcome"></div>
<div ID="about"></div>
<div ID="service"></div>
<div ID="contact-us"></div>

请帮帮我

解决方法

尝试以下代码希望它会有所帮助

    <li><a href="#welcome">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#service">service</a></li>
    <li><a href="#contact-us">Contact</a></li>
    
    Same page link IDs used
    
    <div id="welcome">
    <h1>Welcome</h1>
    In CSS,"id" is a SELEctor that is used to designate an area that a link should point to,SIMILAR TO anchor in HTMl. The nice thing about using id is you can create a link to any element on the page,rather than only the top or bottom. In the following sections,you'll see how to apply id to an HTML tag,and then how to link to it. This example will link to the opening paragraph at the top of this page.In CSS,and then how to link to it. This example will link to the opening paragraph at the top of this page.</div>
    <div id="about">
    <h1>About</h1>
    In CSS,and then how to link to it. This example will link to the opening paragraph at the top of this page.</div>
    <div id="service">
    <h1>service</h1>
    In CSS,and then how to link to it. This example will link to the opening paragraph at the top of this page.</div>
    <div id="contact-us">
    <h1>Contact</h1>
    In CSS,and then how to link to it. This example will link to the opening paragraph at the top of this page.</div>

大佬总结

以上是大佬教程为你收集整理的在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]全部内容,希望文章能够帮你解决在 html 中链接同一页面但 url 获取 index.html/#[object%20Object]所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:html获取