Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2005
    Posts
    48
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Input filed margin problem in IE7

    Hello,

    I have a simple code, below. The problem is that in IE7 there is a 1px gap top and bottom between the input filed border and the div border. In other browser (Firefox, Opera, Chrome) there is no gap at all.

    How can I remove this 1px gap in IE7?

    Thanks in advance!

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <style type="text/css">
    <!--
    .myBox {
    	margin: 0px;
    	padding: 0px;
    	border: 1px solid #000000;
    }
    .myInput {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	margin: 0px;
    	padding: 0px;
    	height: 15px;
    	width: 150px;
    	border: 1px solid red;
    }
    -->
    </style>
    <body>
    	<div class="myBox"><input class="myInput" type="text" name="test" /></div>
    </body>
    </html>

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Try
    Code:
    .myBox {
    	margin: 0px;
    	padding: 0px;
    	border: 1px solid #000000;
    	height:1%;
            overflow:auto;
    }
    .myInput {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 10px;
    	margin: 0px;
    	padding: 0px;
    	height: 15px;
    	width: 150px;
    	border: 1px solid red;
    	float:left;
    }
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •