View Full Version : html option tag styling?
davelf
11-15-2010, 07:34 AM
Hi, here's the problem how to make option tag style like this one?
http://www.dynamicdrive.com/forums/attachment.php?attachmentid=3634&stc=1&d=1289806447
thank you very much
Beverleyh
11-15-2010, 01:52 PM
I'm not sure you can without using Flash. You can use a background image in the CSS to alter the look of the input field, but the drop-down arrow is generated by the browser. The arrow will look nicer in newer browsers and I imagine the nicest (probably very similar to your example pic) in Mac. [please feel free to correct me if I'm wrong though]
<select class="form-field" name="number" id="number">
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
</select>
select.form-field {
background:transparent url("images/form-field.jpg") 0 0 no-repeat;
border:none;
color:#666;
padding:7px;
width:200px;
float:left;
}
davelf
11-16-2010, 02:44 AM
Hi Beverleyh, thx for your reply.
I used the same method like you did, and that right the only problem is the arrow button. I think there's some kind of JS or Jquery to solve this.
Hmm, i think i posted it in the wrong section.
something like this (http://customformelements.net/demopage.php) might be what you're looking for
Beverleyh
11-16-2010, 08:58 AM
I'll make a note of that one too - thanks traq :)
molendijk
11-16-2010, 09:45 PM
From a css-point-of-view, there's not much you can do in the case of (authentic!) select boxes, see this (http://www.let.rug.nl/molendyk/selectboxCrossbrowser2/selectbox.html).
===
Arie Molendijk
davelf
11-18-2010, 03:21 AM
thx traq, Beverleyh's, molendijk
http://www.dynamicdrive.com/forums/attachment.php?attachmentid=3634&stc=1&d=1289806447
You can create a long div at the left with background and the text you want, then the div on the right would be the arrow.
make sure that they float next to each other.
Then add a javascript code that will toggle to show the 3rd div at the bottom.
Inside the 3rd div follow http://web.enavu.com/demos/jquery_hover/ and add exact the same thing.
remove ul border or the div border and change your hover color.
i hope that helps.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.