JSFiddle - React, Tailwind, and code Playground

by David_Knowles

HTML

<h1>Custom styles for the select form element</h1>

<select>
    <option>Firefox</option>
    <option>Chrome</option>
    <option>Internet Explorer</option>
    <option>Safari</option>
</select>

CSS

select {
    position:relative;
    -webkit-appearance:none 
    -moz-appearance: none;
    -prefix-appearance:none;
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    background-color:transparent;
    border:1px solid #b1c4df;
}

/* style your own pulldown arrow */
/* 
select {
    text-indent: 0.01px;
    text-indent: push;
    text-overflow: '';
}
select:after {
    position:absolute;
    top:0;
    right:0;
    content:"your chosen caret symbol;
}
*/


/*

## IE10 ##
    select::-ms-expand {
        display: none;
    }

## IE < 10 ##
Probably position:absolute; and clip:rect; would do the trick
*/



/* == general styling, nothing to do with the fix == */
body {
    font-family: verdana, arial, sans-serif;
    font-size: 12px;
    color: #333;
}
h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 36px;
}
h2 {
    font-size: 18px;
    margin-top: 36px;
}
code {
    background: #ccc;
    font-family: courier, monospaced;
    padding: 0 5px;
}
del {
    color:#ccc;
}
li {
    margin: 10px;
}

a {
    font-weight: bold;
}
small {
    color: #ccc;
}

JavaScript

// Styling standard select pulldown