Last chance to win! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

Aaron Gustafson is putting together a series of articles on how to make select elements stylable. In essence, what his work does is take the select out of the DOM and replace it with a ul, and then add script and CSS to make that ul work like a dropdown list. The advantage this gives is clear to everyone who’s ever complained about how selects aren’t stylable! The series has only just started, and there are a few concerns — the new element can’t be tabbed to, and doesn’t respond to keyboard events — but Aaron promises that part 2 will cover accessibility issues.

The script uses similar techniques to the Suckerfish dropdowns, applying “hover” and “selected” classes to various parts of the ul to provide hooks for styling (since IE doesn’t support :hover on things that aren’t links). This should be a useful technique to watch!

--ADVERTISEMENT--

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?