Actually I am trying to style <select>
box using CSS(no any image as background) my problem is when I view it on mobile devices it show me like a textbox please guide me how to make it like a select box with css.
Note: I don't want any background image in css.
select {
background: -webkit-linear-gradient(white, #666);
border: 1px solid #ccc;
border-radius: 5px;
color: white;
text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
-webkit-appearance: none;
}
You can style select > option , but there are no reliable crossbrowser solution for doing so and, on chrome at least you can at most customize font size, family, background and foreground color.
Styling the button part We can apply CSS properties to the <select> element and change its background color, borders, font, size, margin, padding, and more.
Box drop-down stylingThere are several elements of a select box that can be styled, particularly the height, width, font, border, color, padding, box-shadow and background color.
<select> tags can be styled through CSS just like any other HTML element on an HTML page rendered in a browser. Below is an (overly simple) example that will position a select element on the page and render the text of the options in blue.
You can do it using max-device-width (CSS3):
@media only screen and (max-device-width: 480px) {
select {
background: -webkit-linear-gradient(white, #666);
border: 1px solid #ccc;
border-radius: 5px;
color: white;
text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
-webkit-appearance: none;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With