Solved

Styling Select Box Drop Down

Posted on 2013-11-01
2
636 Views
Last Modified: 2013-11-04
I'm trying to figure out how to style this select drop down box like the attached image.  I've got it close, but still can't figure out how to make the vertical line and the smaller black arrows in the image.

Here is my current code and output:
http://jsfiddle.net/gallitin/3xReG/

<style>
select
{
color: #808080;
font-family: myriad-pro-condensed,sans-serif;
font-size: 14px; 
width:150px;
padding:5px;
}
</style>
<select>
    <option>FILTER</option>
</select>

Open in new window

style-select.jpg
0
Comment
Question by:N R
2 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
You can probably do it wit a background image, but I suspect that it will break the control at that point and you will have to use a hack using scripting and an image swap to simulate the control.

If you want to do that kind of a hack you can probably find something already written using Google.  If you are going to re-invent the world there is no need to re-invent the tools to re-invent the wheel.

Trying to turn a select in to some stylistic bauble has more down side then any possible benefit.  You are just going to harm accessibility, usability, reliability with what you are trying to do.

Cd&
0
 
LVL 42

Accepted Solution

by:
Chris Stanyon earned 500 total points
Comment Utility
Because a <select> element is part of the browser chrome, you won't be able to style it consistently. Normally when you see nicely styled dropdowns like this, the page uses javascript to create something that resembles a drop down. If you look behind the scenes, you'll often find that they're not <select> elements at all - often they'll be buttons, and lists with javacript events wired in to give the impression of a dropdown.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now