Solved

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

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 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