<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SpinOneSolutions &#187; Issue</title>
	<atom:link href="http://www.spinonesolutions.com/tag/issue/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spinonesolutions.com</link>
	<description>I waste my time so that you don't have to...</description>
	<lastBuildDate>Mon, 16 May 2011 17:01:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Long Legend Text Display Issue</title>
		<link>http://www.spinonesolutions.com/2009/04/long-legend-text-display-issue/</link>
		<comments>http://www.spinonesolutions.com/2009/04/long-legend-text-display-issue/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 15:56:54 +0000</pubDate>
		<dc:creator>Will Wright</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[FF]]></category>
		<category><![CDATA[Fieldset]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Issue]]></category>
		<category><![CDATA[Legend]]></category>

		<guid isPermaLink="false">http://www.spinonesolutions.com/?p=194</guid>
		<description><![CDATA[The Problem: I recently built a form for a customer which had a really long legend!  My content area was floated to allow for a right hand sidebar and I noticed that with the addition of the new legend the layout had broken. The issue, it turns out, is that both IE and FF handled [...]]]></description>
			<content:encoded><![CDATA[<h3>The Problem:</h3>
<p>I recently built a form for a customer which had a really long legend!  My content area was floated to allow for a right hand sidebar and I noticed that with the addition of the new legend the layout had broken.</p>
<p>The issue, it turns out, is that both IE and FF handled the legend in an unexpected way.  Let&#8217;s throw down some markup for some examples.</p>
<pre class="html" name="code">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a href="http://www.w3.org/TR/html4/loose.dtd">http://www.w3.org/TR/html4/loose.dtd</a>"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;style type="text/css" media="screen"&gt;
 label,
 input {
  width:100%;
 }
 
 .container {
  width:250px;
 }
 
 fieldset {
 }

 legend {
 }
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div class="container"&gt;
 &lt;fieldset&gt;
  &lt;legend&gt;This is a really long legend as an example, so lets make it really long&lt;/legend&gt;
  &lt;label for="input1"&gt;Input 1&lt;/label&gt;
  &lt;input type="text" id="input1" name="input1" value="input1"&gt;
  &lt;label for="input2"&gt;Input 2&lt;/label&gt;
  &lt;input type="text" id="input2" name="input2" value="input1"&gt;
  &lt;label for="input3"&gt;Input 3&lt;/label&gt;
  &lt;input type="text" id="input3" name="input3" value="input1"&gt;
 &lt;/fieldset&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><img class="aligncenter size-full wp-image-222" title="FF3 Example" src="http://www.spinonesolutions.com/wp-content/uploads/2009/04/ff_ex.jpg" alt="FF3 Example" width="699" height="678" /></p>
<p><img class="aligncenter size-full wp-image-223" title="IE7 Example" src="http://www.spinonesolutions.com/wp-content/uploads/2009/04/ie7_ex.jpg" alt="IE7 Example" width="662" height="586" /></p>
<h3>The Solution:</h3>
<p>The solution for FF3 is exactly what I would expect it to be; add white-space:normal; to the legend style definition.</p>
<pre class="css" name="code">
 label,
 input {
  width:100%;
 }
 
 .container {
  width:250px;
 }
 
 fieldset {
 }

legend {
  white-space:normal;
 }
</pre>
<p><img class="aligncenter size-full wp-image-226" title="FF3 Fixed" src="http://www.spinonesolutions.com/wp-content/uploads/2009/04/ff_fixed.jpg" alt="FF3 Fixed" width="699" height="678" /></p>
<p>The solution for IE7 is a little bit more involved.  We need to nest a span tag within the legend, and then add the white-space attribute; plus a couple of other ornaments.</p>
<pre class="html" name="code">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "<a href="http://www.w3.org/TR/html4/loose.dtd">http://www.w3.org/TR/html4/loose.dtd</a>"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;style type="text/css" media="screen"&gt;
 label,
 input {
  width:100%;
 }
 
 .container {
  width:250px;
 }
 
 fieldset {
 }
 
 legend {
 }
 
 span {
  display:block;
  white-space:normal;
  width:100%;
 }
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div class="container"&gt;
 &lt;fieldset&gt;
  &lt;legend&gt;&lt;span&gt;This is a really long legend as an example, so lets make it really long&lt;/span&gt;&lt;/legend&gt;
  &lt;label for="input1"&gt;Input 1&lt;/label&gt;
  &lt;input type="text" id="input1" name="input1" value="input1"&gt;
  &lt;label for="input2"&gt;Input 2&lt;/label&gt;
  &lt;input type="text" id="input2" name="input2" value="input1"&gt;
  &lt;label for="input3"&gt;Input 3&lt;/label&gt;
  &lt;input type="text" id="input3" name="input3" value="input1"&gt;
 &lt;/fieldset&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><img class=&#8221;aligncenter size-full wp-image-229&#8243; title=&#8221;IE7 Fixed&#8221; src=&#8221;http://www.spinonesolutions.com/wp-content/uploads/2009/04/ie7_fixed.jpg&#8221; alt=&#8221;IE7 Fixed&#8221; width=&#8221;662&#8243; height=&#8221;586&#8243; /</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spinonesolutions.com/2009/04/long-legend-text-display-issue/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

