我想要的按钮:
我试过这个,但它不起作用:
button {
font-family: 'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
border: 3px double #f26700;
background: #f26700;
}
如何使用CSS显示此白线?
答案 0 :(得分:6)
写:
button{
border: 3px double white;
}
OR:
button{
border: 1px double white;
outline: 1px solid #f26700;
}
OR:
button{
border: 2px solid white;
box-shadow:0 0 0 0px white, 0 0 0 2px #F26700;
}
答案 1 :(得分:0)
使用outline属性:
CSS
.button {
font-family:'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
line-height: 1.8em;
border: 1px solid white;
background: #f26700;
width: 100px;
height: 30px;
text-align: center;
outline: 1px solid #f26700;
}
这是JSFiddle:http://jsfiddle.net/2kgGF/
答案 2 :(得分:0)
你可以用大纲来做到这一点。
button {
width: 8rem;
font-size: 1rem;
line-height: 2.4rem;
color: white;
background: darkorange;
border: none;
outline: .1rem solid white;
outline-offset: -.3rem;
}
答案 3 :(得分:0)
评论,2个简单的选择: 盒子阴影和轮廓:
button {
font-family: 'Ubuntu', sans-serif;
font-size: 1em;
font-weight: bold;
color: white;
border: 1px solid white;
background: #f26700;
outline:solid #f26700 1px;
padding:0.25em 1em;
}
button + button {
box-shadow: 0 0 0 1px #f26700;
outline:none;
}