制作一个透明背景和不同图标的按钮[关闭]。

问题描述 投票:-1回答:3

我是一个新的样式表。我想在我的表格上做一个这样的按钮。

enter image description here

我怎样才能做到这一点。

html css font-awesome
3个回答
0
投票
<button class='myBtn'>
  <svg></svg> // here should be an svg get it from the internet
  <span>Clear Selections<span>
</button>
.myBtn {
 display: flex;
 border: 1px solid gray;
 color: black;
 background: ; // ur color here
}

另外,在发布此类问题之前,尽量先做一个调查。


0
投票

当你想在HTMLCSS中做一些基本的事情时,往往有多种方法来实现。 这里有一个使用 "flexbox "样式的简单解决方案。

<div style="display: flex">
  <img src="yourIcon.png"/>
  <span>Clear Selections</span>
</div>

你也可以使用 float 风格。position: absolute-基于风格等。

© www.soinside.com 2019 - 2024. All rights reserved.