Solved

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

Posted on 2011-02-11
2
1,012 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

749 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