Last active
November 26, 2022 09:59
-
-
Save vladimirsiljkovic/ef176cae54d3c4d1992907e1e0723210 to your computer and use it in GitHub Desktop.
Cross-browser (IE11+) <select> element styling without wrapper <div> https://jsbin.com/diqene/edit?html,css,output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select { | |
-webkit-appearance: none; /* Webkit */ | |
-moz-appearance: none; /* FF */ | |
-ms-appearance: none; /* Edge */ | |
appearance: none; /* Future */ | |
/* Optional styles */ | |
padding: 0.3em 1.5em 0.3em 0.6em; | |
border: 1px solid currentColor; | |
background: white; | |
border-radius: 3px; | |
font-size: inherit; | |
background-repeat: no-repeat; | |
background-position: right 5px center; | |
background-size: 1em; | |
background-image: url("http://www.clipartbest.com/cliparts/ncB/75y/ncB75yaji.jpeg"); | |
} | |
/* IE11 */ | |
select::-ms-expand { | |
display: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select> | |
<option value="Lorem">Lorem</option> | |
<option value="Lorem Ipsum">Lorem Ipsum</option> | |
</select> |
Thank you for the ::-ms-expand
trick
Thank you that helped !
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the IE fix.