Html 我应该添加哪些内容以使我的<;选择>;看起来像是精选的?
我正在使用一个按钮库 我正在将这种风格应用于Html 我应该添加哪些内容以使我的<;选择>;看起来像是精选的?,html,css,Html,Css,我正在使用一个按钮库 我正在将这种风格应用于,而且效果很好。但它有一个按钮的外观,而不是选择 我想补充一点▾ 右侧,使其类似于正常选择 所以我的假设是我应该在以下方面做些事情: select.button { /* some style here */ } 我的选择是 <select class="button is-default"> <option>1</option> <option>2</option>
,而且效果很好。但它有一个按钮的外观,而不是选择
我想补充一点▾ 右侧,使其类似于正常选择
所以我的假设是我应该在以下方面做些事情:
select.button {
/* some style here */
}
我的选择是
<select class="button is-default">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
这里有一个。删除行
-webkit外观:无代码>然后您将返回箭头。至少在Google Chrome中使用。-webkit外观:初始代码>?只是出于好奇,你只是滥发css属性而不知道它们的用途吗@TilwinJoy,那不是我的css。我是在Github发现的,当完全重新设置元素的样式时,人们通常会使用div,然后再设置样式。您还可以为我们提供一个插件,例如selectric()。如果只需要向下箭头,可以使用html向下箭头▼
将箭头添加回。是的,但我必须手动将其添加到每个
@drew\w,您知道如何将其添加到所有css选择中吗?但是如何在跨浏览器中执行此操作?@AmitJoki您只需删除该行,默认情况下,您的选择元素在所有浏览器中的外观都会与您想要的一样(使用下拉箭头)。跨浏览器的问题(如果在这种情况下有)是如何使它像所有浏览器中的按钮一样,而不是如何使它像所有浏览器中的普通选择按钮一样。
.button {
text-rendering: optimizeLegibility;
-webkit-appearance: none;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
position: relative;
display: inline-block;
box-sizing: border-box;
margin: 0;
padding: 1px 4px;
border: 1px solid transparent;
border-radius: 2px;
background-color: transparent;
color: inherit;
vertical-align: middle;
text-align: center;
text-decoration: none;
text-transform: none;
white-space: normal;
font-weight: 400;
font-style: normal;
font-size: 13px;
font-family: "OpenSansSemiBold",Helvetica,Arial,sans-serif;
line-height: 20px;
cursor: pointer;
-moz-transition: all .15s ease;
-o-transition: all .15s ease;
-webkit-transition: all .15s ease;
transition: all .15s ease;
}
.button:hover, .button:focus {
outline: 0;
text-decoration: none;
}
.button:active, .button.is-active {
-webkit-box-shadow: none;
box-shadow: none;
text-decoration: none;
}
.button[disabled], .button.is-disabled {
opacity: .7;
filter: alpha(opacity=70);
cursor: not-allowed;
pointer-events: none;
}
.button.is-default {
border-color: #656d78;
background-color: #f5f7fa;
color: #434a54;
}
.button.is-default:hover, .button.is-default:focus {
border-color: #737c89;
background-color: #fff;
}