Solved

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

747 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

16 Experts available now in Live!

Get 1:1 Help Now