<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/1.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Weird IE bug: inputs incorrectly inherit horizontal margins when they&#8217;re in a fieldset</title>
	<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset</link>
	<description>Web Development, Classical Music, Kitties, and whatever else I feel like</description>
	<pubDate>Wed, 20 Aug 2008 22:47:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5</generator>

	<item>
		<title>by: Jennifer Grucza</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-203</link>
		<pubDate>Wed, 01 Sep 2004 14:27:10 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-203</guid>
					<description>I managed to find &lt;a href=&quot;http://www.themaninblue.com/writing/perspective/2004/03/24/#comment42&quot;&gt;one other reference to this bug&lt;/a&gt; on The Man in Blue, but alas, there is no fix or work-around mentioned.

I tried just canceling out the margin, by applying a negative margin using a CSS hack, but there's no way for me to tell IE only to apply it to inputs of a certain type, since IE doesn't understand input[type=&quot;text&quot;] selectors.</description>
		<content:encoded><![CDATA[	<p>I managed to find <a href="http://www.themaninblue.com/writing/perspective/2004/03/24/#comment42">one other reference to this bug</a> on The Man in Blue, but alas, there is no fix or work-around mentioned.</p>
	<p>I tried just canceling out the margin, by applying a negative margin using a CSS hack, but there&#8217;s no way for me to tell IE only to apply it to inputs of a certain type, since IE doesn&#8217;t understand input[type=&#8221;text&#8221;] selectors.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Matthom</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-208</link>
		<pubDate>Thu, 02 Sep 2004 10:05:36 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-208</guid>
					<description>Interesting. I wasn't aware of that type of selector. I didn't know it existed.

Thanks for the mention of the bug, though. I will keep an eye out. I'm sure it will come up in my own work...</description>
		<content:encoded><![CDATA[	<p>Interesting. I wasn&#8217;t aware of that type of selector. I didn&#8217;t know it existed.</p>
	<p>Thanks for the mention of the bug, though. I will keep an eye out. I&#8217;m sure it will come up in my own work&#8230;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jennifer Grucza</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-209</link>
		<pubDate>Thu, 02 Sep 2004 10:43:23 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-209</guid>
					<description>Yeah, they're in the &lt;a href=&quot;http://www.w3.org/TR/REC-CSS2/selector.html#attribute-selectors&quot;&gt;CSS2 spec&lt;/a&gt;.  It's a pretty useful tool to have, just too bad IE doesn't support it.  I think that's the kind of selector people use when they have those &lt;a href=&quot;http://www.ryanbrill.com/archives/designating-offsite-links/&quot;&gt;little images next to offsite links&lt;/a&gt;.</description>
		<content:encoded><![CDATA[	<p>Yeah, they&#8217;re in the <a href="http://www.w3.org/TR/REC-CSS2/selector.html#attribute-selectors">CSS2 spec</a>.  It&#8217;s a pretty useful tool to have, just too bad IE doesn&#8217;t support it.  I think that&#8217;s the kind of selector people use when they have those <a href="http://www.ryanbrill.com/archives/designating-offsite-links/">little images next to offsite links</a>.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ethan</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-213</link>
		<pubDate>Fri, 03 Sep 2004 09:38:24 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-213</guid>
					<description>If you toss the &amp;#60;input&amp;#62; into a paragraph, that should erase the horizontal margin you're seeing.</description>
		<content:encoded><![CDATA[	<p>If you toss the &#60;input&#62; into a paragraph, that should erase the horizontal margin you&#8217;re seeing.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ollie</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-747</link>
		<pubDate>Thu, 24 Feb 2005 09:26:06 -0800</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-747</guid>
					<description>There's a very similar bug in IE where it always adds a 1px margin above and below any of the elements you've mentioned, such as an input of type text. As yet I've found no way of getting rid of it (played around with margin:0, padding:0, and paragraphs as suggested above - none of them work for get rid of the problem though :( )

PS I know this thread is pretty old now but it's driven me insane, this glitch... hopefully some time in the future somebody with the same problem will be saved by finding this before it drives them mad too!</description>
		<content:encoded><![CDATA[	<p>There&#8217;s a very similar bug in IE where it always adds a 1px margin above and below any of the elements you&#8217;ve mentioned, such as an input of type text. As yet I&#8217;ve found no way of getting rid of it (played around with margin:0, padding:0, and paragraphs as suggested above - none of them work for get rid of the problem though <img src='http://jennifergrucza.com/blog/wp-images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  )</p>
	<p>PS I know this thread is pretty old now but it&#8217;s driven me insane, this glitch&#8230; hopefully some time in the future somebody with the same problem will be saved by finding this before it drives them mad too!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ollie</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-748</link>
		<pubDate>Thu, 24 Feb 2005 11:20:16 -0800</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-748</guid>
					<description>OMG. I never actually had anything against IE until I begun developing web pages. Why, why Lord, did the most widely used browser have to be the most utterly useless when it comes to css?! Gah! Anyway, on the verge of giving up, after a solid 48 hours, I hit a workaround for my extra 1px top and bottom margin bug for all input elements. I was using a table to lay out the form, so gave each particular cell type its own class (e.g. .centredcellsmall {padding-left:64px; padding-right:64px; etc etc etc; height:43px;}. Now IE rendered this as 45px high (and not 43px) because it added +1px margin/padding/whatever to the top and bottom of the input element. And it was impossible to write this out using display:inline or margin:0px none or padding 0px or anything. What I had to do was change the class to height:41px (i.e. 2px smaller than desired, so that when IE added the annoying 2px total margin it appeared as 43px). Then I added in the following extra css2 selector below the first one: td[class=&quot;centredcellsmall&quot;] {height:43px;}. IE can't read advanced selectors so ignores this. But Mozilla etc can read it, so draws the cell 43px. NB I needed to set td {padding-top:0px; padding-bottom:0px} too to stop that interfering. What a nightmare.</description>
		<content:encoded><![CDATA[	<p>OMG. I never actually had anything against IE until I begun developing web pages. Why, why Lord, did the most widely used browser have to be the most utterly useless when it comes to css?! Gah! Anyway, on the verge of giving up, after a solid 48 hours, I hit a workaround for my extra 1px top and bottom margin bug for all input elements. I was using a table to lay out the form, so gave each particular cell type its own class (e.g. .centredcellsmall {padding-left:64px; padding-right:64px; etc etc etc; height:43px;}. Now IE rendered this as 45px high (and not 43px) because it added +1px margin/padding/whatever to the top and bottom of the input element. And it was impossible to write this out using display:inline or margin:0px none or padding 0px or anything. What I had to do was change the class to height:41px (i.e. 2px smaller than desired, so that when IE added the annoying 2px total margin it appeared as 43px). Then I added in the following extra css2 selector below the first one: td[class=&#8221;centredcellsmall&#8221;] {height:43px;}. IE can&#8217;t read advanced selectors so ignores this. But Mozilla etc can read it, so draws the cell 43px. NB I needed to set td {padding-top:0px; padding-bottom:0px} too to stop that interfering. What a nightmare.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jared</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-1043</link>
		<pubDate>Fri, 22 Apr 2005 11:00:05 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-1043</guid>
					<description>IE WHITESPACE ISSUE

The space above and space below an element can usually be eliminated by simply providing NO whitespace in your code around that element. That means your photo might look like:



Instead of a more human readable:


  


But at least this technique eliminates the need for CSS hacks. Anyway, I've found that rescues me from that situation often, and my code and css remain compliant and hack free... just harder to read.

As far as the input elements go (and the real reason I found this page in the first place) - I didn't want to wrap the input elements with a  tag because that would throw errors in validation. So what I did was throw a  tagset around the . I gave it a class name (inputProtector) so I could apply styles but even before I defined styles, it fixed the problem. This fixed my TEXT, TEXTAREA, and SUBMIT fields.

Thanks for the great idea guys!</description>
		<content:encoded><![CDATA[	<p>IE WHITESPACE ISSUE</p>
	<p>The space above and space below an element can usually be eliminated by simply providing NO whitespace in your code around that element. That means your photo might look like:</p>
	<p>Instead of a more human readable:</p>
	<p>But at least this technique eliminates the need for CSS hacks. Anyway, I&#8217;ve found that rescues me from that situation often, and my code and css remain compliant and hack free&#8230; just harder to read.</p>
	<p>As far as the input elements go (and the real reason I found this page in the first place) - I didn&#8217;t want to wrap the input elements with a  tag because that would throw errors in validation. So what I did was throw a  tagset around the . I gave it a class name (inputProtector) so I could apply styles but even before I defined styles, it fixed the problem. This fixed my TEXT, TEXTAREA, and SUBMIT fields.</p>
	<p>Thanks for the great idea guys!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jared</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-1044</link>
		<pubDate>Fri, 22 Apr 2005 11:03:59 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-1044</guid>
					<description>Sorry to double post- but I see that in my above comment the code got removed. Dang. I'll redo the code with parenthesis instead so you'll still know what I mean:

This hides spaces above below elements:

(div)(img src=...)(/div)

Nicer human readable that causes issue:

(div)
  (img src=...)
(/div)

I put a (div class=&quot;inputProtector&quot;) tagset around the (input) tag.

There, I hope that makes more sense... and doesn't get wiped out when I submit this comment!</description>
		<content:encoded><![CDATA[	<p>Sorry to double post- but I see that in my above comment the code got removed. Dang. I&#8217;ll redo the code with parenthesis instead so you&#8217;ll still know what I mean:</p>
	<p>This hides spaces above below elements:</p>
	<p>(div)(img src=&#8230;)(/div)</p>
	<p>Nicer human readable that causes issue:</p>
	<p>(div)<br />
  (img src=&#8230;)<br />
(/div)</p>
	<p>I put a (div class=&#8221;inputProtector&#8221;) tagset around the (input) tag.</p>
	<p>There, I hope that makes more sense&#8230; and doesn&#8217;t get wiped out when I submit this comment!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: BubblesSOC.Net  &raquo; ie fieldset bug</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-1137</link>
		<pubDate>Wed, 04 May 2005 07:40:44 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-1137</guid>
					<description>[...]  thorough research, but as far as i know, there is no workaround for this bug.  i did find someone else [...]</description>
		<content:encoded><![CDATA[	<p>[&#8230;]  thorough research, but as far as i know, there is no workaround for this bug.  i did find someone else [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Frank Butcher</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-3525</link>
		<pubDate>Thu, 27 Apr 2006 03:58:51 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/31/weird-ie-bug-inputs-incorrectly-inherit-horizontal-margins-when-theyre-in-a-fieldset#comment-3525</guid>
					<description>An old problem I know but I came across this the other day, you can wrap a span around the input and set the maring to 0 on the span

(span style=&quot;margin:0;&quot;)(input type=&quot;file&quot;/)(/span)</description>
		<content:encoded><![CDATA[	<p>An old problem I know but I came across this the other day, you can wrap a span around the input and set the maring to 0 on the span</p>
	<p>(span style=&#8221;margin:0;&#8221;)(input type=&#8221;file&#8221;/)(/span)
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

