1 回答
TA贡献1777条经验 获得超10个赞
您可以像下面这样调整您的代码:
select {
/* styling */
background-color: white;
border: thin solid blue;
border-radius: 4px;
display: inline-block;
font: inherit;
line-height: 1.5em;
padding: 0.5em 3.5em 0.5em 1em;
--g:transparent 50%, gray 50% calc(50% + 1px), transparent calc(50% + 2px);
background-image:
linear-gradient(45deg, var(--g)),
linear-gradient(-45deg, var(--g));
background-position:
right 20px top calc(1em + 2px),
right 15px top calc(1em + 2px);
background-size: 5px 5px;
background-repeat: no-repeat;
/* reset */
margin: 0;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: none;
}
<select>
<option>option 1</option>
<option>option 2</option>
<option>option 3</option>
</select>
添加回答
举报