For some reason the select
rails tag results in a very ugly grey select box. I've been looking around for a way to change this, I'm guessing some sort of default CSS is generated for select boxes by rails but since I have deleted the default stylesheet that rails builds I have no idea where these settings would be set from. 开发者_StackOverflow中文版
How can I change this ugly default style?
What is the default CSS for a select (outside of ruby)?
EDIT: Turns out the problem is that I"m running it on VirtualBox Linux and the default select box there is the problem.
It's probably the browser default?
Adding select { } to your stylesheet and then customizing it with your own rules will cover all the tags without adding a class to every select box you create. Not that that's a bad idea.
Perhaps you should just override select in one of your CSS files?
css: .select { … }
view: <%= select(…, :class => "whatever") %>
Take a look in /railsproject/public/stylesheets.
It's dependent on your operating system, and CSS gives you very little control of how it looks. If you are using jQuery, you could use a plugin such as this.
精彩评论