簡體   English   中英

如何使整個元素可點擊?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM