<?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>vsellis.com&#187; Code</title>
	<atom:link href="http://www.vsellis.com/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vsellis.com</link>
	<description>TECHNOLOGY TRANSLATED, Making IT Makes Sense</description>
	<lastBuildDate>Mon, 02 Jan 2012 13:55:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://www.vsellis.com/?pushpress=hub'/>
		<item>
		<title>Fix Dropdown Menus That Fall Behind Embeded Video</title>
		<link>http://www.vsellis.com/code/fix-dropdown-menus-that-fall-behind-embeded-video/</link>
		<comments>http://www.vsellis.com/code/fix-dropdown-menus-that-fall-behind-embeded-video/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 16:00:48 +0000</pubDate>
		<dc:creator>Scott Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.vsellis.com/?p=1477</guid>
		<description><![CDATA[Update 12/2011: YouTube is now embedding with iframes so you&#8217;ll need to add ?wmode=opaque to the end of the video url in the iframe. For example: &#60;iframe width=&#8221;560&#8243; height=&#8221;315&#8243; src=&#8221;http://www.youtube.com/embed/2TmfGoJEgwg?wmode=opaque&#8221; frameborder=&#8221;0&#8243; allowfullscreen&#62;&#60;/iframe&#62; Original Post Starts Here&#8230;&#8230; Javascript menus which drop down from a main navigation menu (mouse over &#8220;About&#8221; on this site to see a single<a href="http://www.vsellis.com/code/fix-dropdown-menus-that-fall-behind-embeded-video/" rel="nofollow"> ...Read More</a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update 12/2011:</strong> <a title="VSEllis on YouTube" href="http://youtube.com/vsellis" target="_blank">YouTube</a> is now embedding with iframes so you&#8217;ll need to add <strong>?wmode=opaque</strong> to the end of the video url in the iframe.</p>
<p>For example:</p>
<p>&lt;iframe width=&#8221;560&#8243; height=&#8221;315&#8243; src=&#8221;http://www.youtube.com/embed/2TmfGoJEgwg<strong>?wmode=opaque</strong>&#8221; frameborder=&#8221;0&#8243; allowfullscreen&gt;&lt;/iframe&gt;</p>
<p><em>Original Post Starts Here&#8230;&#8230;</em></p>
<p>Javascript menus which drop down from a main navigation menu (mouse over &#8220;About&#8221; on this site to see a single item dropdown as an example) have a nasty habit of getting layered behind an embedded video. I haven&#8217;t tested this fix on all videos but if you&#8217;re embedding YouTube or other videos with similar embed code there is an easy solution.</p>
<p>In your parameter tags you need to add the following tag</p>
<div class="geshi no html">
<div class="head"></pre>
</div>
<ol>
<li class="li1">
<div class="de1">and inside the actual embed tag you need to add the following parameter
</div>
</li>
<li class="li1">
<div class="de1">&lt;pre lang=&quot;html&quot;&gt;wmode=&quot;transparent&quot;</div>
</li>
</ol>
</div>
<p>So your final source may look like this (code is from the <a href="http://www.openca.mp/">OpenCa.mp</a> video we released).</p>
<p><object style="float: left;" width="520" height="320" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/vYC9tjfb4jk&amp;hl=en_US&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6" /><param name="allowfullscreen" value="true" /><param name="wmode" value="transparent" /><embed style="float: left;" width="520" height="320" type="application/x-shockwave-flash" src="http://www.youtube.com/v/vYC9tjfb4jk&amp;hl=en_US&amp;fs=1&amp;color1=0x006699&amp;color2=0x54abd6" allowFullScreen="true" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" /><!-- NEW PARAMETER! --> <!-- NEW PARAMETER is right after the source url in the EMBED tag --> </object></p>
<p>That should keep your menus from dropping behind your video. Don't forget to add this to each video that is near your nav!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vsellis.com/code/fix-dropdown-menus-that-fall-behind-embeded-video/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>5 CSS Tips for Cross Browser Compatibility</title>
		<link>http://www.vsellis.com/code/5-css-tips-for-cross-browser-compatibility/</link>
		<comments>http://www.vsellis.com/code/5-css-tips-for-cross-browser-compatibility/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 18:00:21 +0000</pubDate>
		<dc:creator>Scott Ellis</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.vsellis.com/?p=799</guid>
		<description><![CDATA[Despite the fact that the death of IE6 is upon us getting CSS based websites to work across browser is still a dirty job, so much so I sometimes with Mike Rowe would cover it as a gag episode. Even when IE6 finally does die, there are still issues to be had with IE7+ vs.<a href="http://www.vsellis.com/code/5-css-tips-for-cross-browser-compatibility/" rel="nofollow"> ...Read More</a>]]></description>
			<content:encoded><![CDATA[<p>Despite the fact that the <a title="Death of IE6" href="http://www.downloadsquad.com/2009/07/20/youtube-and-digg-help-speed-up-the-slow-death-of-ie6/" target="_blank">death of IE6</a> is upon us getting CSS based websites to work across browser is still a dirty job, so much so I sometimes with <a title="Mike Rowe Dirty Jobs" href="http://dsc.discovery.com/fansites/dirtyjobs/dirtyjobs.html" target="_blank">Mike Rowe</a> would cover it as a gag episode. Even when IE6 finally does die, there are still issues to be had with IE7+ vs. FireFox, &#8230;</p>
<p>So to help things along I&#8217;ll give you 5 things I always do by default to help build my sites to look good on all browsers right out of the gate. This doesn&#8217;t mean that more tweaking isn&#8217;t sometimes required but these get me a long way toward the goal.<br />
<strong>1. IE6 Double Margin Issue.</strong> This has been well documented but bears repeating here. If you are just starting with css based layouts (as opposed to table based layouts) this will save you hours of maddening trouble shooting. The problem is that IE6 will double the margin that is in the same direction of a float. For example, if you float two boxes to the left and next to each other and the left box has a left margin of 10px, in IE6 you will get a left margin (on the left box) of 20px. It&#8217;s a bug, don&#8217;t try to understand it. So it would render as below:</p>
<div id="attachment_801" class="wp-caption alignleft" style="width: 433px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; float: left;"><a title="FireFox Float Left with no display:inline;" href="http://www.vsellis.com/wp-content/uploads/2009/07/css-float-left-no-inline-ff.gif"><img class="size-full wp-image-801" title="css-float-left-no-inline-ff" src="http://www.vsellis.com/wp-content/uploads/2009/07/css-float-left-no-inline-ff.gif" alt="css-float-left-no-inline-ff" width="423" height="226" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">How it should look, and does, in FireFox.</p></div>
<div style="clear:both;"></div>
<div id="attachment_802" class="wp-caption alignleft" style="width: 433px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; float: left;"><a href="http://www.vsellis.com/wp-content/uploads/2009/07/css-float-left-no-inline-ie6.gif"><img class="size-full wp-image-802" style="clear:both;" title="css-float-left-no-inline-ie6" src="http://www.vsellis.com/wp-content/uploads/2009/07/css-float-left-no-inline-ie6.gif" alt="css-float-left-no-inline-ie6" width="423" height="226" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">IE6 float:Left with no display:inline;</p></div>
<div style="clear:both;"></div>
<p>The code in the case of this example was as follows:</p>
<div class="geshi no css">
<div class="head">.outer { //creates the outer box</div>
<ol>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">width</span><span class="sy0">:</span> <span class="re3">400px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">height</span><span class="sy0">:</span> <span class="re3">200px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">000000</span></span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#cccc66</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.leftbox</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">width</span><span class="sy0">:</span> <span class="re3">100px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">height</span><span class="sy0">:</span> <span class="re3">90px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">margin</span><span class="sy0">:</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span><span class="sy0">;</span> //<span class="kw1">left</span> <span class="kw1">margin</span> is the fourth <span class="re3">10px</span> value <span class="br0">&#40;</span>it goes clockwise from the <span class="kw1">left</span>, top-<span class="kw1">margin</span>, right-<span class="kw1">margin</span>, bottom-<span class="kw1">margin</span>, left-<span class="kw1">margin</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">000000</span></span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#cccc22</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.rightbox</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">width</span><span class="sy0">:</span> <span class="re3">100px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">height</span><span class="sy0">:</span> <span class="re3">90px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">margin</span><span class="sy0">:</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">000000</span></span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#cccc99</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>Fortunately, the fix is rather easy, make sure to add display:inline; to the float:left; and the margin will correct itself as below:</p>
<div class="geshi no css">
<div class="head">.outer { //creates the outer box</div>
<ol>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">width</span><span class="sy0">:</span> <span class="re3">400px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">height</span><span class="sy0">:</span> <span class="re3">200px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">000000</span></span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#cccc66</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.leftbox</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">inline</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">width</span><span class="sy0">:</span> <span class="re3">100px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">height</span><span class="sy0">:</span> <span class="re3">90px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">margin</span><span class="sy0">:</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span><span class="sy0">;</span> //<span class="kw1">left</span> <span class="kw1">margin</span> is the fourth <span class="re3">10px</span> value <span class="br0">&#40;</span>it goes clockwise from the <span class="kw1">left</span>, top-<span class="kw1">margin</span>, right-<span class="kw1">margin</span>, bottom-<span class="kw1">margin</span>, left-<span class="kw1">margin</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">000000</span></span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#cccc22</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">.rightbox</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">inline</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">width</span><span class="sy0">:</span> <span class="re3">100px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">height</span><span class="sy0">:</span> <span class="re3">90px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">margin</span><span class="sy0">:</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span> <span class="re3">10px</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">border</span><span class="sy0">:</span> <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">000000</span></span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#cccc99</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<div id="attachment_800" class="wp-caption alignnone" style="width: 433px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center;"><img class="size-full wp-image-800" title="css-float-left-inline-ie6" src="http://www.vsellis.com/wp-content/uploads/2009/07/css-float-left-inline-ie6.gif" alt="css-float-left-inline-ie6" width="423" height="226" /><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">IE6 float:Left with display:inline;</p></div>
<div style="clear:both;"></div>
<p><strong>2. This is a design technique.</strong> When I&#8217;m building a new theme from scratch I&#8217;ll often start with all of my margins set to 0px. Boxes will float next to each other but I&#8217;ll move them out later. I first work through padding on my div&#8217;s then start to adjust margins. Once you&#8217;ve build a site/theme or two it get&#8217;s much easier but I&#8217;ve found it to be quicker and easier to start with 0 margins and work from there rather than going back and trying to figure out why things do work correctly cross-browser after development.</p>
<p><strong>3.Image Resizing in CSS</strong>. The quick lesson here is don&#8217;t do it. Generally browsers do a less than ideal job of dynamically rendering the image and cross-browser it can create inconsistencies. On top of that, and a better reason not to do it, is that you still have to load the full image on that page which makes your page weight (how much &#8220;stuff&#8221; has to be downloaded for the page to fully render) much heavier and thus slower. The easy solution is just don&#8217;t do it, re size your images (and optimize them) with another tool and upload accordingly.</p>
<p><strong>4. Clear Your Floats:</strong> This refers to divs which serve as containers to other divs and should wrap around them but sometimes don&#8217;t. So when you create a wrapper with div&#8217;s inside it should look like this:</p>
<div id="attachment_813" class="wp-caption alignleft" style="width: 433px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; float: left;"><a href="http://www.vsellis.com/wp-content/uploads/2009/07/container.gif"><img class="size-full wp-image-813" title="container" src="http://www.vsellis.com/wp-content/uploads/2009/07/container.gif" alt="container" width="423" height="226" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">How the container should wrap around div&#39;s</p></div>
<div style="clear:both;"></div>
<p>But sometimes they end up like this:</p>
<div id="attachment_812" class="wp-caption alignleft" style="width: 433px;  border: 1px solid #dddddd; background-color: #f3f3f3; padding-top: 4px; margin: 10px; text-align:center; float: left;"><a href="http://www.vsellis.com/wp-content/uploads/2009/07/bad-container.gif"><img class="size-full wp-image-812" title="bad-container" src="http://www.vsellis.com/wp-content/uploads/2009/07/bad-container.gif" alt="bad-container" width="423" height="226" /></a><p style=' padding: 0 4px 5px; margin: 0;'  class="wp-caption-text">What sometimes happens to containers</p></div>
<div style="clear:both;"></div>
<p>The biggest problem is that you may not notice it until you try to put a background in place and it doesn&#8217;t look right. The issue can generally be fixed by adding &#8220;overflow: auto;&#8221; or &#8220;overflow:hidden;&#8221; to the containing div. You&#8217;ll also want to make sure to specify a width or heigh to trigger hasLayout for IE6 compatibility (use something like height: 1% if you need to, works well). However, if you still don&#8217;t get it to work you might need to find another way of <a href="http://www.sitepoint.com/blogs/2005/02/26/simple-clearing-of-floats/" target="_blank">clearing the floated div</a>.<br />
<strong></strong></p>
<p><strong>5. Font Sizing: </strong>In the body tag of your style sheet set your font as a percentage of the default size (16px). So for a 12pt font set the font size to 75% (font-size: 75%) then throughout the remainder of the body where you set font size do so using em (not px or pt).For more reading on em&#8217;s see <a title="How to Size Text in CSS" href="http://www.alistapart.com/articles/howtosizetextincss/" target="_blank">How to Size Text in CSS at A List Apart</a>.</p>
<p>There are more good techniques but this should get you a long way toward greater CSS cross-browser compatibility right out of the gate. Another good read on the topic:</p>
<p><a title="How to get Cross Browser Compatibility Every Time" href="http://anthonyshort.com.au/blog/comments/how-to-get-cross-browser-compatibility-everytime/" target="_blank">Anthony Short: How to get Cross Browser Compatibility Every Time</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vsellis.com/code/5-css-tips-for-cross-browser-compatibility/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

