Home >Web Front-end >CSS Tutorial >CSS removes select drop-down arrow style

CSS removes select drop-down arrow style

高洛峰
高洛峰Original
2017-03-02 15:48:241944browse

Without further ado, I’ll just post the css code for you. The specific code is as follows:

select {   
  /*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
  border: solid 1px #000;   
  /*很关键:将默认的select选择框样式清除*/
  appearance:none;   
  -moz-appearance:none;   
  -webkit-appearance:none;   
  /*在选择框的最右侧中间显示小箭头图片*/
  background: url("http://ourjs.github.io/static/2015/arrow.png") no-repeat scroll rightright center transparent;   
  /*为下拉小箭头留出一点位置,避免被文字覆盖*/
  padding-right: 14px;   
}   
/*清除ie的默认选择框样式清除,隐藏下拉箭头*/
select::-ms-expand { display: none; }

Okay, that’s the end of the code. I hope it’s helpful. It will be helpful to everyone. If you have any questions, please leave a message and the editor will reply to you in time!

For more CSS related articles on removing the select drop-down arrow style, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn