I have an issue in Chrome where there are "two" borders when I use rounded corners on a select menubox (see below, the top is an input box and the bottom is the select box)
input, select {
border:2px solid #ced6e9;
-moz-border-radius:8px;
border-radius: 8px;
}
I've tried two other approaches, but they don't work:
Rounded corners in Chrome not working doesn't work and
setting -webkit-appearance: none;
but this removes the little button indicating it's a select box
Edit I'm using Windows 7 (service pack 1) with Chrome v18
See this jsFiddle example
The CSS border-radius property defines the radius of an element's corners. Tip: This property allows you to add rounded corners to elements!
The border-radius property is used to add rounded corners to an element in CSS. The border-radius property is shorthand for the four subproperties used to add rounded corners to each corner of a web element.
Now, to give rounded corners we have to use the border-radius property. The border-radius property is used to round the corners of an element. We can set a single radius to make the corners circular, or two radii to make corners elliptical. This property can contain one, two, three, or four values.
CSS Syntaxborder-radius: 1-4 length|% / 1-4 length|%|initial|inherit; Note: The four values for each radius are given in the order top-left, top-right, bottom-right, bottom-left. If bottom-left is omitted it is the same as top-right. If bottom-right is omitted it is the same as top-left.
Had this problem before and all I did was remove the border on the select and wrap it in a div with the same style (rounded borders). I'm sure there's a more elegant solution but it was better than searching for hours/days for a solution.
Check out this fiddle.
What version of Windows are you using? Sometimes the OS will force additional graphical quirks onto certain HTML elements. Things appear to behave as desired in Chrome 18 on Windows 7 with an Aero theme enabled. I actually answered a similar question yesterday with an example for styling select
element to replace the graphical elements lost with -webkit-appearance: none
: https://stackoverflow.com/a/10074928/1030243. Hopefully, if no other solution is found, you can implement it with a few extra lines of CSS.
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