Solved

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

Posted on 2011-02-11
2
1,010 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

896 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

11 Experts available now in Live!

Get 1:1 Help Now