Nachshon Schwartz
Nachshon Schwartz

Reputation: 15765

select boxes design

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.

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.

Upvotes: 1

Views: 891

Answers (3)

Slick23
Slick23

Reputation: 5897

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.

Upvotes: 1

dangerousdave
dangerousdave

Reputation: 6408

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.

Upvotes: 0

jschorr
jschorr

Reputation: 3054

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.

Upvotes: 0

Related Questions