Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Difference in border appearance in IE between an ASP Drop Down List and a Text Box.

Posted on 2011-02-11
2
Medium Priority
?
1,017 Views
Last Modified: 2012-05-11
Take a close look at the attached image.  This image is a screenshot from IE 8 (v 8.0.7600) of a web form I just built.  Notice how there’s a disparity in the border-style between the Drop Down Lists (which are select elements at the browser level) and the Text Boxes (which are input,  type = text elements at the browser level).  It looks as if IE is attempting to slightly recess the text boxes.  I’d like to eliminate the disparity.  Is it as simple as tweaking the border-style and border-width properties in the CSS sheet?  Or, is there more to it than that?  

It’s worth noting that disparity only exists in IE.  The border style associated with the two types of controls looks identical in Firefox, Chrome, and Safari.
It's also worth noting that I've tried the following (and a few permutations on the following) with minimal success:

border: solid thin black;
IE-Drop-Down-Text-Box-Difference.png
0
Comment
Question by:jdana
2 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 1000 total points
ID: 34875064
Yes.  In general if you want select and textboxes to have the same look you need to specifically style them - any inputs actually - as the settings are based on the user's theme otherwise....

You can use CSS like this:


input[type=text], input[type=password], textarea
{
	border: solid 1px #0000FF;
	/* etc... */
}
input[type=text]:hover, input[type=password]:hover, textarea:hover
{
	border: solid 1px #00FF00;
        /* etc... */
}
input[type=text]:focus, input[type=password]:focus, textarea:focus
{
	border-color: #FF0000;
        /* etc... */
}

input[disabled]
{
	background-color: #EEEEEE;
	/* etc... */
}

select
{ 
	border: solid 1px #0000FF;
	/* etc... */
}
select:hover
{
	border: solid 1px #00FF00;
	/* etc... */
}
select:focus
{
	border: solid 1px #FF0000;
	/* etc... */
}

input[type=button], input[type=submit]
{
	    /* etc... */
}

Open in new window

0
 

Author Closing Comment

by:jdana
ID: 34882522
Perfect.

Thanks!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

879 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