473,765 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

double margin bug in ie without floats!?

8 New Member
I have a really strange layout bug in a web page, that only appears in IE. An INPUT element inside a DIV is getting an extra left margin, the same as the parent DIV has been given.

It is as if the old "double margin on floats" was kicking in, but there are no floats in this layout! And it only affects the INPUT, not text or a SELECT within the same DIV...
I would really need some pointers on how to attack this.

Thanks / Mike

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2. <html>
  3.   <head>
  4.     <title>inputmargin.html</title>
  5.   </head>
  6.   <body>
  7.     <div style="width: 35em; background-color: blue;">
  8.       <div style="width: 20em; margin-left: 10em; background-color: green;">
  9.         This input gets an extra 10em margin:<br>
  10.         <input type="text">
  11.         <br>
  12.         But this dropdown doesn't:<br>
  13.         <select></select>
  14.       </div>
  15.     </div>
  16.   </body>
  17. </html>
Sep 13 '06 #1
4 2886
drhowarddrfine
7,435 Recognized Expert Expert
Yes, this is an IE bug (among a bazillion others). The only fix I am aware of is to enclose the inputs in a <p>. I don't recall much beyond that.
Sep 13 '06 #2
mikewse
8 New Member
Hi - thanks for the input!
So you don't reckon there is a way to fix this in CSS only, without adding additional markup?
(Trying to do layouts with semantically clean markup is a challenge...;-)

Best regards
Mike
Sep 13 '06 #3
drhowarddrfine
7,435 Recognized Expert Expert
Well, IE sometimes forces you to do goofy things. Inputs need to be enclosed anyway so there's nothing wrong with doing that. You'll eventually need the form element so:
<form>
<p>
<input .....>
</p>
</form>

or you could/should look into fieldsets. I don't know if you'll have the same problem though.
Sep 13 '06 #4
mikewse
8 New Member
My complete page actually has both <form> and <fieldset> wrapping the shown markup, but unfortunately they don't improve this particular problem.
Thanks for the help!
Best regards
Mike
Sep 14 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4741
by: trialanderror | last post by:
I've been happily chugging along thinking I understood floating divs and now find that I know a lot less than I thought I did. And the more I try "fixing" things, the worse it gets. A lot of what I'd been doing looked okay in IE 6.0, but in Gecko browsers like my Netscape 7.1 (I've been told they conform better to the standards than does IE), they look terrible. http://trialanderror.100freemb.com/20040115FloatDiv.html is a page I put...
8
2592
by: Warren Post | last post by:
Here's a problem I've never seen before. On <http://snow.prohosting.com/srcopan/anti/>, should the viewport width be less than the width of the page's header, then the right margin becomes stuck at the viewport's right edge. This is perhaps better observed than described; try it yourself at narrow viewport widths and/or high zoom levels. I am guessing that I've mucked up something in the CSS's margin settings, but I can't find it by...
1
4052
by: Marek Mänd | last post by:
I have question regarding (clearing) floats and margin-top on DL and HR elements. http://www.hot.ee/idaliiga/testcases/dl/language-chosing-selector.htm Namely the IE6 doesnt calculate the margin-top on the DL (definition list) element correctly. It starts to add topmargin at current fontsizes and layout when i tell him to have 38px topmargin. Can this be fixed somehow to normal?
10
6282
by: tbcarver | last post by:
I have a table that I am trying to add a bottom margin to in IE. I have found that if the table is inside more than 1 div then the shape of the containing div collapses. Please look at this example in IE and then in FireFox: Table inside 1 Div: http://hughaxton.com/NewsGroups/IE1DivTable.html Table inside 2 Divs:
26
2524
by: meltedown | last post by:
I have 2 left floating divs on a page. Sometime the left side is larger, sometimes the right side is larger. I want the page to have a margin at the bottom of whichever div is the largest. If I put a bottom margin on one of the divs, it might not be the largest div, in which case the margin won't show up. If I put the margin on both divs, when the right floats below the left side in a small window, there is too much margin between the...
6
28099
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box. 1. Each box takes up 50% of the parent. 2. One of the box has a border width of 1px.
7
14967
by: subramanian100in | last post by:
In the post with heading "Learning C - Scanf or Getch, or Getchar not working correctly after first loop" that appears in today's list in comp.lang.c, it has been mentioned in the answer to this post, that double should be preferred to float when space is not a constraint. Can someone explain why double should be preferred to float ?
6
3867
by: John Moore | last post by:
My mysql data type is double(16,2) with '0.00' specified as default. These represent dollars and cent amounts. My question is: How do I perform simple mathematical operations on these money amounts without PHP changing them to integers? I only need to add or subtract these numbers without any rounding or chopping off of the '.00' if they come up zero cents. Looking at the PHP docs, the only helpful suggestion I could find is that if...
22
2773
by: Bill Reid | last post by:
I just noticed that my "improved" version of sscanf() doesn't assign floating point numbers properly if the variable assigned to is declared as a "float" rather than a "double". (This never cropped up before, since I rarely use "float"s for anything, and hardly ever use the function for floating-point numbers in the first place; I just was messing around testing it for all cases and noticed a problem.) Anyway, it is declared and I...
0
9399
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.