Was just wondering if there was a way to style select options inline. I know, inline.
Particularly font-family. Giving a dropdown to select a font, and I want them to see the font.
BTW, the title is supposed to be
but the parser didn’t like that.
So you want a dropdown so that users can change the font that they see on your website? Something like that?
Either way you’ll need to look into some PHP or JS.
You could do something similar to this, but change it from buttons to a select and font-size to font-family: http://stackoverflow.com/questions/891980/allow-users-to-change-font-size-in-a-webpage
I can do the PHP and JS, my question is the CSS!
If I do this:
The inline styling simply doesn’t work and I’m wondering if there is a way to style them without any excessive CSS classes.
Dropdown options can be styled…but it’s extremely limited. Colors are fine, font types are not. If you really need to style things, better avoid SELECT and OPTION and make a “fake” dropdown.
See http://jsfiddle.net/senff/bcQkN/1/ for an example of attempting to style a real dropdown, and a quick example of an HTML/CSS mock dropdown (which obviously needs a little more code behind it).
You must be logged in to reply to this topic.