链接按钮时遇到问题

时间:2020-10-20 10:16:35

标签: html css

我只是学习html,并且对链接按钮有疑问。你能告诉我我在做什么错吗?

</style>
<body>
<button onClick="name.html" class="button" ><span>name </span> </button>
<br>

1 个答案:

答案 0 :(得分:1)

在您的应用程序中,您应该使用锚链接,因为该按钮主要在表单中使用。相应的HTML标记为<a>。 如果要使链接看起来像一个按钮,则可以给它一个类并使用CSS进行设计。

<a href="name.html" class="button">name</a>

   
<style>
    .button {
          background-color: #4CAF50;
          border: none;
          color: white;
          padding: 15px 32px;
          text-align: center;
          text-decoration: none;
          display: inline-block;
          font-size: 16px;
    }
</style>
相关问题