Link to home
Start Free TrialLog in
Avatar of JRockFL
JRockFLFlag for United States of America

asked on

Make selects wider

I'm trying to use uniformjs.com
but I'm not sure how I can the selects wider.

Any ideas?
Avatar of Tomun
Tomun
Flag of United Kingdom of Great Britain and Northern Ireland image

Change the width in the css. File uniform.default.css around line 298:

div.selector select {
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  width: 190px;
}
Sorry you'll also need to change the width of div.selector span which is just after the other above.
Avatar of JRockFL

ASKER

Thanks for the reply. I just to increase both widths, but the select remains the same.
Can you verify?
Which browser are you using?

I did my test in Firefox on their website, using the firebug addon to inspect the element and find out where its css settings were. Editing the two settings did change the width, the second setting changed the collapsed view's width and the first the size of the dropdown.

It may use different elements in different browsers though or have browser specific css rules for the select. For me the visible part of the select was <span style="-moz-user-select: none;">Option 1</span> so maybe in your browser it's not using a span.

I found this piece of documentation at https://github.com/pixelmatrix/uniform :

"To edit the CSS of Uniform it is highly recommended to not edit the theme files, but to override them using CSS. Make sure your CSS file comes after the uniform theme css file in the HEAD section.

It’s common to want to resize the selects or other elements. The best way is to set the width property on the div element, span element and the form element itself. Look through the theme CSS in the presentation section to see where the width property is currently set."

So it seems like we're trying the right thing, except not using a separate css file which sounds like a good idea.
Avatar of JRockFL

ASKER

I tried it in firefox too with firebug and it did not change
Avatar of JRockFL

ASKER

can you send me a screen shot of larger and what you changed?
ASKER CERTIFIED SOLUTION
Avatar of Tomun
Tomun
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRockFL

ASKER

perfect, works for me too. thank you