is there a way to make the select options like the above? how to remove the default img in the select options? thank you.
http://tutorialzine.com/2010/11/better-select-jquery-css3/
This is a really good tutorial from a reliable site :)
I'm aware it uses jQuery but also makes use of CSS3
This is a good question! Ive been searching for the solution for this along time. My belief is that, this is the bestest solution:
http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/
You use it with jQuery UI and fully edit with css. However even more better solution would be making fully div and li based dropdown-menu with a hidden input, if you want to use it in a form.
Related
I'd like for all the options in a select menu to be centered, however I can't find a way of doing it.
After a quick google I couldn't find any real solutions, however most of the entries are quite old, so I'm wondering if there have been any improvements made to css to make this possible.
The closest I've found is to use text indentation, which may well work for the options that are the same length, but for any options of varying lengths it of course looks off.
You might be interested in using ul and li instead of a traditional select and option.
Bootstrap has a component that lets you do this: Single button dropdowns.
You can use their component and add a style similar to this:
ul.btn-dropdown li {
text-align: center;
}
You can get a result like this:
HTML/CSS doesn't provide for formatting Option elements within Select lists - only for formatting the whole Select list.
You could try padding with spaces but, realistically, I'd concentrate on more important issues and let Select lists be Select lists.
(JQuery may have something to offer, but I do straight Javascript so am not familiar enough to know).
Tony Duffill
Does anyone know if there is a pure css way to apply styles to a select tag only when the dropdown is open. I thought that maybe the :active, or :focus would do what I was hoping for, but it's not quite right. It's possible to for a select tag to have a focused state without the dropdown being open, so the style still applies. I know I can very easily add some javascript to accomplish this, but I am looking for a pure css way. Thanks in advance.
Unfortunately, there isn't really a way to do this. Using the :enabled tag will just style the select box, when unclicked.
You can try making your own select box with HTML/CSS and a little bit of JS.
here is a great tutorial on how to do so.
I would try doing :enabled but if that doesn't work here is a reference to all the style selectors.
http://www.w3schools.com/cssref/css_selectors.asp
EDIT: I just did some testing and :focus only applied when it was open.
I have a small problem with an HTML select:
<select>
<option>...</option>
<option>...</option>
<option>...</option>
</select>
By default all the options will be shown underneath the select field and I can't seem to change their direction. What I need is to show up over the select field instead of underneath.
How would that be possible?
That's pretty much impossible (without custom JavaScript-based elements) since select and option are elements built-in to the OS and browser.
One way to think about it: all drop-down menus are styled so that all listings are below the field. If you make yours different, some people may be confused, and that's not a good thing.
It's not possible dude, sory... I have done the research for you but nothing appears to be a solution to your problem...
Seeing it the good way, you might be the one that comes up with the JavaScript code for this and post the solution on your own question, and answer the question for future users that need the same stuff
Keep moving and you'll get it. Good luck
You could try to use this in your CSS:
direction: rtl;
You can do it inline for your select or give it a class/id. I was able to reverse the direction of my select menu by using this. I had to change some of the styles though because it pushed my text to the right a bunch. See this answer.
Hope that helps!
It is very easy with links and images. One could just specify title="Something" to get a nice tooltip over an element. But somehow I don't see any convenient way to do the same to a button. Seems like HTML itself miss this option at the first place.
But maybe there is at least a handy workaround for that?
Jesse Gumm from nitrogenweb googlegroup shared a nice way to do this
#button{text="Submit",postback=whatever,actions="obj('me').title=\"Some title\""}
I have my page set up the way I want but when I try to add a button beneath the image on the left side of the page everything go a little crazy. I've been struggling with this for a little while not sure what to try next
Here's a visual:
http://jsfiddle.net/xFD8q/10/
Thanks
Revise your HTML, mixing DIVS with Tables isn't usually the best idea.
If you're unsure that your HTML is valid you can validate it via W3C Markup Validation found here
I made a fiddle with a revised markup but left the refactoring of the CSS to you.
The fiddle has inline CSS which is not recommended but it was the fastest way to do it! :)
Here's the fiddle
Good luck! :D