Styling a <form> <select> drop-down

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Styling a <form> <select> drop-down

Post by Gen-ik »

Is it possible to change the style of the border and button on a <select> box in a <form>?

Using BORDER: or BORDER-STYLE doesn't work.

I want to try and change them to A: fit in with the rest of my site, and B: because they look damn ugly!

Any ideas?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

yes, they can be ugly depending on one's layout. Unfortunatly they are hardly styleable. Try this

Code: Select all

<html>
<head>
	<style type="text/css">
		select &#123;	color: white;	background-color: blue;
				border-color: red; line-height: 1cm;
			&#125;
   </style>
</head>
<body>
	<form>
		<select>
			<option>one</option>
			<option>two</option>
			<option>three</option>
		</select>
	</form>
</body>
</html>
in ie, mozilla & opera and all fun is history :evil:
googleling around I found this site: http://sangrea.net/gspot/dropdowns.php
worth a visit
Post Reply