gpt4 book ai didi

html - 按钮超链接问题 HTML/CSS

转载 作者:行者123 更新时间:2023-12-04 15:16:31 26 4
gpt4 key购买 nike

我是初学者。我希望我的按钮是由一个带有图标的圆圈创建的,它是我的 Twitter 帐户的超链接,我尝试了很多方法来做到这一点,但都没有奏效。预先感谢您的回答。任何帮助将不胜感激。
HTML:

<button type="button" id="twitter-icon">
<img src="img/twitter-icon.svg">
</button>
CSS:
#twitter-icon {
border: none;
color: none;
text-decoration: none;
cursor: pointer;
display: inline-block;
backface-visibility: hidden;
background-color: none;
width: 0px;
height: 0px;
display: inline-block;
margin-right: 70px;
margin-top: 150px;
}

最佳答案

用 anchor 标签包裹你的按钮就可以了

<a id="twitter-link" href="your_twitter_link">
<button type="button" id="twitter-icon">
<img src="https://www.choiceofgames.com/icons/appstore.svg">
</button>
</a>

关于html - 按钮超链接问题 HTML/CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64229787/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com