Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select and Text fields inner margin

Status
Not open for further replies.

dbaseboy

Programmer
Apr 24, 2002
48
GB
Hi all,

Im trying to style my text field and select fields, I've managed to change background color, font etc and right align the text however on the select fields this is not a good thing as the letters are right against the drop down arrow.

I've tried all sorts but cant seem to work out how to put some padding within the field allowing the data to be viewed clearly.

Any ideas?
 
According to this article: , the select control is not well-implemented in most browsers. You might try adding a class with a padding-right attribute, but I haven't tried it.

For example, in FF1.5 the background color of the selection in Sample 2 doesn't appear but in IE7 it does. In my experience, FF is usually right and IE is usually wrong, so go figure.

Anyway the article gives you some other pointers that might be useful.

HTH

Mike Krausnick
Dublin, California
 
You can specify the width on the <select> tag, give it enough width and the arrow for the dropdown won't be in the way.

[monkey][snake] <.
 
Have you tried applying CSS to the <option> instead/as well? You need to be aware that even if it works in one browser, it probably won't in others.

Change the colours if you have to, beyond that it's best not to tinker too much with form controls if you value your sanity.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top