[英]How do I make the whole element clickable?
所以这是我拥有的 HTML 代码:我想让按钮也可点击,因为现在只有文本是可点击的。 我也想将按钮链接到锚点:“表单”。
<div class="banner-header" style="text-align: center;">
<p class="button primary" style="font-family: Montserrat, sans-serif; font-style: normal; text-decoration: none; background-color: #ffffff; border: 1px solid #ffffff; border-radius: 50px; color: #ffffff; fill: #ffffff; font-size: 20px; padding: 12px 35px; text-transform: none;">
<a style="color: #f36e5b; font-weight: bold; text-decoration: none;" href="#form" rel="nofollow noopener">Request Free Trial</a>
</p>
您已经在<p>
标记内编写了一个自定义按钮。
So, here you can add a cursor style to your button CSS along with other CSS styles, which you have written inside <p>
tag.
此外,当您添加点击 function 时,将其添加到<p>
标记中以使整个按钮可点击。
<p style="cursor: pointer" (click method/formsubmission behavior here)>
<a> Request Free Trial </a>
</p>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.