<?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>eingko weblog &#187; XHTML/CSS</title>
	<atom:link href="http://www.eingko.net/blog/category/xhtmlcss/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eingko.net/blog</link>
	<description>a web developer's thoughts and musings</description>
	<lastBuildDate>Wed, 09 Dec 2009 23:42:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Internet Explorer, Flash, Alignment Gotcha</title>
		<link>http://www.eingko.net/blog/2008/11/19/internet-explorer-flash-alignment-gotcha/</link>
		<comments>http://www.eingko.net/blog/2008/11/19/internet-explorer-flash-alignment-gotcha/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 21:16:15 +0000</pubDate>
		<dc:creator>eingko</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[XHTML/CSS]]></category>

		<guid isPermaLink="false">http://www.eingko.net/blog/?p=33</guid>
		<description><![CDATA[I ran into a rather annoying issue the other day related to content alignment in Flash; as usual, this problem exists exclusively in Internet Explorer. To be more specific, it is an issue with how the Flash Player ActiveX control is written.
If you are aligning content in Flash that uses the Stage width or height [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a rather annoying issue the other day related to content alignment in Flash; as usual, this problem exists exclusively in Internet Explorer. To be more specific, it is an issue with how the Flash Player ActiveX control is written.</p>
<p>If you are aligning content in Flash that uses the Stage width or height as a variable (e.g., you want to center a MovieClip) and you do it on initialization (i.e., in code and on the first frame), you may run in to this issue.  Here is an image demonstrating what you might see:</p>
<p><img src="http://www.eingko.net/blog/wp-content/uploads/2008/11/ie_flash_bug.gif" alt="" title="Internet Explorer, Flash, Alignment Gotcha" width="400" height="440" class="alignleft size-full wp-image-34" style="border: none;" /></p>
<p>Note that in the &#8220;before&#8221; screen, the content is centered horizontally, while in the &#8220;after&#8221; screen, the content is only half-visible and appears to be &#8220;centered&#8221; on the left margin.</p>
<p>If you run a test &#8211; output the Stage width to a text field, you&#8217;ll see that the width will be returned as 0.</p>
<p>As far as I know, there are two solutions to this problem.  If you&#8217;re embedding your Flash using swfObject, then make sure that you omit the &#8220;scale&#8221; attribute. For example, modify the following:</p>
<pre class="code">
var params = {
    bgcolor: "#000000",
    menu: "false",
    scale: "noScale",
    allowFullScreen: true
};
</pre>
<p>To something that looks like this:</p>
<pre class="code">
var params = {
    bgcolor: "#000000",
    menu: "false",
    allowFullScreen: true
};
</pre>
<p>Alternatively, if you absolutely need that attribute.  You can create an &#8220;EnterFrame&#8221; event listener that detects when the Stage width is greater than 0 and then remove the listener.  Here&#8217;s an example in ActionScript 2:</p>
<pre class="code">
this.onEnterFrame = function() {
    if (Stage.width > 0) {
        init(); // Pass to initialization function
        this.onEnterFrame = null; // Clear enterFrame listener
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.eingko.net/blog/2008/11/19/internet-explorer-flash-alignment-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phark Image Replacement (Modified) for IE5</title>
		<link>http://www.eingko.net/blog/2006/05/10/phark-image-replacement-modified-for-ie5/</link>
		<comments>http://www.eingko.net/blog/2006/05/10/phark-image-replacement-modified-for-ie5/#comments</comments>
		<pubDate>Wed, 10 May 2006 23:06:56 +0000</pubDate>
		<dc:creator>eingko</dc:creator>
				<category><![CDATA[XHTML/CSS]]></category>

		<guid isPermaLink="false">http://www.eingko.net/blog/?p=16</guid>
		<description><![CDATA[When it comes to image replacement, I tend to use the Phark method; I won&#8217;t go into the reasoning behind my preference, but if one were interested in the various methods, etc. I would recommend Dave Shea&#8217;s Revised Image Replacement article.  Unfortunately one of the pitfalls of the Phark method is the fact that [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to image replacement, I tend to use the <a title="Phark Image Replacement" href="http://phark.typepad.com/phark/2003/08/accessible_imag.html">Phark</a> method; I won&#8217;t go into the reasoning behind my preference, but if one were interested in the various methods, etc. I would recommend Dave Shea&#8217;s <a title="Revised Image Replacement" href="http://www.mezzoblue.com/tests/revised-image-replacement/">Revised Image Replacement</a> article.  Unfortunately one of the pitfalls of the Phark method is the fact that it fails in Internet Explorer 5 (PC).  Today, I have an ammendment to this method, which resolves the problem.  Take the following example:</p>
<pre class="code">
&lt;h3 id="header"&gt;
    Revised Image Replacement
&lt;/h3&gt;
</pre>
<pre class="code">
/* css */
#header {
    text-indent: -100em;
    overflow: hidden;
    background: url(sample-opaque.gif);
    height: 25px;
}
</pre>
<p>This is the Phark method of Image Replacement.  Here&#8217;s my modification:</p>
<pre class="code">
&lt;h3 id="header"&gt;
    Revised Image Replacement
&lt;/h3&gt;
</pre>
<pre class="code">
/* css */
#header {
    text-indent: -100em;
    overflow: hidden;
    background: url(sample-opaque.gif);<strong>
    background-position: 100em 0;</strong>
    height: 25px;
}
</pre>
<p>Of course, in its current state it <em>won&#8217;t work with anything, except Internet Explorer 5 (PC)</em>.  So, we throw in the <a title="Simplified Box Model Hack" href="http://www.info.com.ph/%7Eetan/w3pantheon/style/modifiedsbmh.html">Simplified Box Model Hack</a>:</p>
<pre class="code">
&lt;h3 id="header"&gt;
    Revised Image Replacement
&lt;/h3&gt;
</pre>
<pre class="code">
/* css */
#header {
    text-indent: -100em;
    overflow: hidden;
    background: url(sample-opaque.gif);
    <strong>background-position: 100em 0;
    bac\kground-position: 0 0;</strong>
    height: 25px;
}
</pre>
<p>Knowing that browsers position images to the top and left by default, I thought that Internet Explorer 5 (PC) was probably setting the image where the text was being forced (or, indented), etc. Of course in a real world situation, it would probably be better to use a <a title="Conditional comments" href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">conditional comment</a> to change the background-position for Internet Explorer 5 (PC) instead of resolving to hacks.</p>
<p><strong>Update:</strong></p>
<p>It turns out that this method doesn&#8217;t resolve the issue in Internet Explorer 5 for Macintosh; but, using &#8220;overflow: visible&#8221; will accomplish the same result.  So in order to get this to work for the Mac version, we&#8217;ll need something like this:</p>
<pre class="code">
&lt;h3 id="header"&gt;
    Revised Image Replacement
&lt;/h3&gt;
</pre>
<pre class="code">
/* css */
#header {
    text-indent: -100em;
    background: url(sample-opaque.gif);
    background-position: 100em 0;
    bac\kground-position: 0 0;
    height: 25px;<strong>
    line-height: 25px;
    overflow: visible;
    /* Hide from IE 5 Mac \*/
    overflow: hidden;
    /* End hide from IE 5 Mac */</strong>
 }
</pre>
<p>And that should take care of any issues in Internet Explorer 5 for Macintosh.  You&#8217;ll notice that I&#8217;ve also added a &#8220;line-height&#8221; declaration.  The reason (and this may be obvious) is because if the line-height is not set to the same value as the declared height (in this case 25px), the browser will render enormous spaces below the replaced heading.</p>
<p>If you don&#8217;t want to use hacks within the actual stylesheet, you may want to check out <span class="local">Tantek Ã‡elik</span>&#8217;s <a title="IE5/Mac Band Pass Filter" href="http://www.stopdesign.com/examples/ie5mac-bpf/">IE5/Mac Band Pass Filter</a>.  Of course, some may wonder how using a &#8220;filter&#8221; is that much different from a &#8220;hack&#8221;, but that&#8217;s outside the scope of this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eingko.net/blog/2006/05/10/phark-image-replacement-modified-for-ie5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Liquid Multi-column Floated Lists</title>
		<link>http://www.eingko.net/blog/2006/02/06/liquid-multi-column-floated-lists/</link>
		<comments>http://www.eingko.net/blog/2006/02/06/liquid-multi-column-floated-lists/#comments</comments>
		<pubDate>Mon, 06 Feb 2006 22:10:47 +0000</pubDate>
		<dc:creator>eingko</dc:creator>
				<category><![CDATA[XHTML/CSS]]></category>

		<guid isPermaLink="false">http://www.eingko.net/blog/?p=9</guid>
		<description><![CDATA[Every now and then I&#8217;ll design a web site for a client that incorporates a multi-column list.  Typically this list is on the homepage, so we would create a module that would allow the client/user to enter in values in a textfield and then a server-side language would render the page upon request.  [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then I&#8217;ll design a web site for a client that incorporates a multi-column list.  Typically this list is on the homepage, so we would create a module that would allow the client/user to enter in values in a textfield and then a server-side language would render the page upon request.  Last month I decided to find a more efficient method, one that could be used repeatedly and would not require a custom interface to be built just to use it.  Of course the <abbr title="What You See Is What You Get">WYSIWYG</abbr> editor that is built into our <abbr title="Content Management System">CMS</abbr> allows the client to create a two-column table that can be used to serve the same purpose, but that method assumes that the client/user is familiar with the process; which is rarely the case.</p>
<p>To get to the point, I put together a <em><abbr title="unordered list">ul</abbr></em> element that would display within content blocks but not clear other <em><abbr title="unordered list">ul</abbr></em> elements.  The code:</p>
<pre class="css">ul {
float: left;
clear: none;
display: block;
min-width: 40%;
padding: 0 20px 0 0;
}</pre>
<p>Because floated elements are required to have a width, I opted for a percentage and went with it.  This worked perfectly in Firefox, but when I tested it in <abbr title="Internet Explorer">IE</abbr>, the second <em><abbr title="unordered list">ul</abbr></em> wrapped and appeared below the first.  I tried lowering the width to a smaller number, and after several successive attempts, I finally ended up with:</p>
<pre class="css">ul {
float: left;
clear: none;
display: block;
min-width: 20%;
padding: 0 20px 0 0;
}</pre>
<p>I&#8217;m not sure why the larger widths did not work in <abbr title="Internet Explorer">IE</abbr>, but making it smaller seems to have solved the problem.</p>
<p>As soon as I finished, I decided to add <em><abbr title="paragraph">p</abbr></em> tags above and below to make sure everything worked properly in context.  Upon doing so, I discovered that because the <em><abbr title="unordered list">ul</abbr></em> elements were floating, the paragraphs would, as a result, wrap around them.  No problem, I just cleared the <em><abbr title="paragraph">p</abbr></em> tags:</p>
<pre class="css">p {
clear: both;
}</pre>
<p>Viola; client/user controlled multi-column floated lists.  Now whenever the client/user wants to float one list next to another, all that is required is to insert something like this into the body:</p>
<pre class="html4strict">&lt;ul&gt;
&lt;li&gt;list item one &lt;/li&gt;
&lt;li&gt;list item two &lt;/li&gt;
&lt;li&gt;list item three &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;list item one &lt;/li&gt;
&lt;li&gt;list item two &lt;/li&gt;
&lt;li&gt;list item three &lt;/li&gt;
&lt;/ul&gt;</pre>
<p>Or as he/she would see it:</p>
<ul>
<li>list item one</li>
<li>list item two</li>
<li>list item three</li>
</ul>
<ul>
<li>list item one</li>
<li>list item two</li>
<li>list item three</li>
</ul>
<p>The <abbr title="Cascading Style Sheet">CSS</abbr> will automatically cause the lists to float alongside.  An added bonus is that if any particular list element happens to exceed the maximum width of the parent element (the body) the second list will automatically wrap below the second.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eingko.net/blog/2006/02/06/liquid-multi-column-floated-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
