简体   繁体   English

如何使用一个按钮链接到另一个HTML页面?

[英]How to link to another html page with one button?

I am able to have another html page appear when clicking "register" but it is currently separate from the "register" button that I had originally created. 单击“注册”时,我可以显示另一个html页面,但它目前与我最初创建的“注册”按钮分开。 The href sits right beside the button created and unable to find a way to make it sit inside the button. href位于创建的按钮旁边,无法找到使其位于按钮内部的方法。 Is there another way to do this to have it work inside the button? 还有另一种方法可以使它在按钮中起作用吗?

I've tried adding the Register which works inside of the button that I created but it did not work, the button breaks 我尝试添加可在我创建的按钮内使用的寄存器,但该按钮不起作用,按钮断开

       <a class="btn" href="Register.html"> Register</a>
        <button
          type="submit"
          class="btn btn-secondary btn-block"
          id="registerLink"
         ></button>

Working on a "Log in" form. 使用“登录”表单。 On the click of the register button the register form I had completed previously should appear. 单击注册按钮后,应显示我之前填写的注册表格。 I am trying to get back 1 single button in my class="btn btn-secondary btn-block" button. 我想找回我的class =“ btn btn-secondary btn-block”按钮中的1个按钮。

You have two buttons. 您有两个按钮。 One of them doesn't have a closing tag. 其中一个没有结束标签。 That's going to result in unpredictable behavior. 这将导致不可预测的行为。 I am not sure I fully understand your question. 我不确定我是否完全理解您的问题。

Add the same classes to the link that you have added to the button and it should now look like a button instead of a link. 将相同的类添加到已添加到按钮的链接中,它现在看起来应该像按钮而不是链接。

 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <a href="Register.html" class="btn btn-secondary btn-block"> Register</a> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 单击html5中的按钮/链接时如何将一个页面导航到另一个页面 - how to navigate one page to another page when click on button/link in html5 如何将一个html页面链接到另一个文件夹中的另一个页面 - How to link one html page to another one in another folder 如何打开一个新的 html 页面以及一键点击链接 - How to open a new html page and also a link at one button click 如何在一个HTML页面上使用JavaScript和DOM从外部链接到另一个HTML页面 - How to use JavaScript & DOM on one html page to externally link to another html page 一页上的JavaScript按钮链接可在另一页上显示隐藏的div - JavaScript button link on one page to show hidden div on another page 如何使用按钮将一个 JS 页面链接到另一个 JS 页面 - How do I use a button to link one JS page to another JS page 如何使用链接或按钮等关闭html页面? - How close html page with link or button , etc? 单击按钮或链接时如何专注于另一个 html 页面的特定部分 - How to focus on a particular portion of an another html page when click on a button or link 如何使整个表格成为一个按钮/到另一个HTML页面的链接? - How do I make an entire Table a button/link to another HTML page? HTML / Javascript如何将按钮链接到另一个按钮? - HTML/Javascript How can I link a button to another button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM