Html 带边框的 CSS 透明按钮
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25484894/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 02:33:34 来源:igfitidea点击:
CSS Transparent buttons with borders
提问by Tom TriumphentGames
I am trying to make a button in css like this one
我正在尝试在 css 中制作一个像这样的按钮
but I have no idea how to do it as I am new to css. This is what I tried:
但我不知道该怎么做,因为我是 css 新手。这是我尝试过的:
.gbtnHollow {
background: transparent;
height: 38px;
line-height: 40px;
border: 2px solid white;
display: inline-block;
float: none;
text-align: center;
width: 120px;
padding: 0px!important;
font-size: 14px;
color: #fff;
}
.gbtnHollow:hover {
color: #fff;
background: rgba(255, 255, 255, 0.2);
}
回答by Justinas
回答by Jozef Dúc
回答by Kanan tuteja
Its simple. add this css to button:
这很简单。将此css添加到按钮:
button {
background: none;/*this for transparent button*/
border: 1px solid black;/* this is for button border*/
position: relative;
left: 150px;
top: 80px;
}
回答by Ashish Dev
#button {
width: 150px;
height: 50px;
border:none;
border:solid 2px black;
border-radius: 5px;
background: rgba(255, 255, 255,0);
font-size: 25px;
}
#button:hover {
background:black;
color:white;
}