【问题标题】:How to add popup to a button in Wordpress如何将弹出窗口添加到 Wordpress 中的按钮
【发布时间】:2021-08-11 09:54:17
【问题描述】:

我收到以下代码,我想在我的网站上添加一个按钮。当我点击它时,它会将我转发到同一页面上的网站,但我希望它与网站一起打开一个新标签 (开始加“

<a 
  class="button" 
  style="
    background-color: #24baef; 
    color: #1c212e; 
    font-size: 14px; 
    font-weight: 600; 
    padding: 3.5px 17.5px; 
    border-radius: 5px;
  " 
  href="https://www.youtube.com/"
> 
  Button 
</a>

最好的问候, 达诺维克

【问题讨论】:

标签: php html wordpress


【解决方案1】:

在锚标记内使用目标属性“_blank”。

<a class="button" style=
"background-color: #24baef; 
color: #1c212e; 
font-size: 14px; 
font-weight: 600; 
padding: 3.5px 17.5px; 
border-radius: 5px;" 
href="https://youtube.com/" target="_blank">

更多参考:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a https://www.w3schools.com/tags/att_a_target.asp

【讨论】:

    猜你喜欢
    • 2021-10-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-21
    • 2017-04-21
    • 2019-11-12
    • 2021-10-09
    相关资源
    最近更新 更多