<?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>Ninja CSS Blog</title>
	<atom:link href="http://ninjacss.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://ninjacss.com/blog</link>
	<description>html, css, javascript &#38; other stuff</description>
	<lastBuildDate>Mon, 09 Nov 2009 15:01:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS &#8211; image/background transparency</title>
		<link>http://ninjacss.com/blog/2009/11/09/css-imagebackground-transparency/</link>
		<comments>http://ninjacss.com/blog/2009/11/09/css-imagebackground-transparency/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 14:59:36 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=121</guid>
		<description><![CDATA[
filter:alpha(opacity=90);
-khtml-opacity: 0.9;
-moz-opacity:0.9;
opacity: 0.9;

Now for the different ways of setting opacity…
For Internet Explorer:

filter: alpha(opacity=90);

For Mozilla:

-moz-opacity: 0.9;

For Safari (current):

opacity: 0.9;

This is the important one.  It is the current standard supported by Safari, Opera and Firefox
For Safari (old):

-khtml-opacity: 0.9;

This is for older versions of Safari, back before it adopted webkit (which is what you use for something [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: css">
filter:alpha(opacity=90);
-khtml-opacity: 0.9;
-moz-opacity:0.9;
opacity: 0.9;
</pre>
<p>Now for the different ways of setting opacity…</p>
<p>For Internet Explorer:</p>
<pre class="brush: css">
filter: alpha(opacity=90);
</pre>
<p>For Mozilla:</p>
<pre class="brush: css">
-moz-opacity: 0.9;
</pre>
<p>For Safari (current):</p>
<pre class="brush: css">
opacity: 0.9;
</pre>
<p>This is the important one.  It is the current standard supported by Safari, Opera and Firefox</p>
<p>For Safari (old):</p>
<pre class="brush: css">
-khtml-opacity: 0.9;
</pre>
<p>This is for older versions of Safari, back before it adopted webkit (which is what you use for something like round borders).</p>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/11/09/css-imagebackground-transparency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; Selector hacks</title>
		<link>http://ninjacss.com/blog/2009/11/05/css-selector-hacks/</link>
		<comments>http://ninjacss.com/blog/2009/11/05/css-selector-hacks/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 16:30:02 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=115</guid>
		<description><![CDATA[.someClass {
  padding-top: 10px; /* shows in all browsers */
  *padding-top: 10px; /* shows in IE7 and below */
  _padding-top: 10px; /* shows in IE6 and below */
  *padding-top: 10px;_padding-top:10px; /*shows in IE7 and IE6 */

]]></description>
			<content:encoded><![CDATA[<pre class="brush: css">.someClass {
  padding-top: 10px; /* shows in all browsers */
  *padding-top: 10px; /* shows in IE7 and below */
  _padding-top: 10px; /* shows in IE6 and below */
  *padding-top: 10px;_padding-top:10px; /*shows in IE7 and IE6 */
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/11/05/css-selector-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Curse you 2.8.5!</title>
		<link>http://ninjacss.com/blog/2009/10/27/curse-you-2-8-5/</link>
		<comments>http://ninjacss.com/blog/2009/10/27/curse-you-2-8-5/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 13:31:04 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=99</guid>
		<description><![CDATA[I hate when I upgrade WP and my plugin(s) break. Please bear with me as I figure out how to fix my blog =)
]]></description>
			<content:encoded><![CDATA[<p>I hate when I upgrade WP and my plugin(s) break. Please bear with me as I figure out how to fix my blog =)</p>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/10/27/curse-you-2-8-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; image swap</title>
		<link>http://ninjacss.com/blog/2009/07/16/css-image-swap/</link>
		<comments>http://ninjacss.com/blog/2009/07/16/css-image-swap/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 15:00:45 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[image swap]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=35</guid>
		<description><![CDATA[What You Want To Do: You have a horizontal (or vertical) menu list &#8211; when you hover over each item, you want it to &#8220;change&#8221; so that it indicates you&#8217;re mousing over it and you don&#8217;t want to use Javascript to accomplish this. 
How To Do It: Instead of &#8220;swapping&#8221; out the original image and [...]]]></description>
			<content:encoded><![CDATA[<p>What You Want To Do: You have a horizontal (or vertical) menu list &#8211; when you hover over each item, you want it to &#8220;change&#8221; so that it indicates you&#8217;re mousing over it and you don&#8217;t want to use Javascript to accomplish this. </p>
<p>How To Do It: Instead of &#8220;swapping&#8221; out the original image and the image you see when you hover over, we&#8217;re going to make the original image go away. Think of this as a disappearing act.</p>
<p>First, I&#8217;ll show you what my horizontal list looks like:</p>
<p><img src="http://farm4.static.flickr.com/3487/3726011673_c029e15cb3_o.png" /></p>
<p>The code: </p>
<pre class="brush: html">
<ul class="headerMenuList">
<li class="home"><a href=""><img src="/imgs/home.jpg" /></a></li>
<li class="findProviders"><a href=""><img src="/imgs/findProviders.jpg" /></a></li>
<li class="findPayers"><a href=""><img src="/imgs/findPayers.jpg" /></a></li>
<li class="news"><a href=""><img src="/imgs/news.jpg" /></a></li>
<li class="educationalTools"><a href=""><img src="/imgs/educationalTools.jpg" /></a></li>
<li><a href=""><img src="/imgs/end.jpg" /></a></li>
</ul>
</pre>
<p>So there I have inserted the images (normal state) into the &lt;li&gt; tags of my menu list. Next we&#8217;re going to add some CSS styles.</p>
<p>In my case, I want a horizontal list that does not have bullets, so I will need to make the &lt;li&gt; tags display inline, else it will give me a vertical list and style the list style type with none. Make sure you add the display block style to the li&#8217;s a element. If you don&#8217;t do that, the images will flicker when you hover over them. Try it with and without that style and you&#8217;ll see what I mean.</p>
<pre class="brush: css">
ul.headerMenuList li {
  list-style-type: none; //gets rid of the bullets next to each item
  float: left;
}

ul.headerMenuList li a {
  display: block; //make sure you add this style, else the images will flicker when you hover over them!
}

ul.headerMenuList li img {
  border: none;
}
</pre>
<p>You&#8217;re going to have different images for each menu item so you&#8217;ll have to give each item a separate class. Then in the CSS, you&#8217;ll give each of those classes a different background image to use which serves as the hover image.</p>
<p>Also, you&#8217;ll need to style the a element (with the image) when it&#8217;s being hovered over. When you hover over the item, you want to give it the effect of swapping/changing. What we&#8217;ll do here is add a visibility styling (hidden). That way, when you hover over the &lt;li&gt; (that already has a background image) it will hide the normal state image and display the hover image (background image).</p>
<p>Here&#8217;s my menu when you hover over &#8220;Home&#8221;:</p>
<p><img src="http://farm4.static.flickr.com/3455/3726013795_f36f75eed0_o.png" /></p>
<p>The CSS looks like this:</p>
<pre class="brush: css">
ul.headerMenuList li.home {
  background-image: url(/imgs/home_on.jpg);
  background-repeat: no-repeat;
}

ul.headerMenuList li.home a:hover img {
  visibility: hidden;
}

ul.headerMenuList li.findProviders {
  background-image: url(/imgs/findProviders_on.jpg);
  background-repeat: no-repeat;
}

ul.headerMenuList li.findProviders a:hover img {
  visibility: hidden;
}

ul.headerMenuList li.findPayers {
  background-image: url(/imgs/findPayers_on.jpg);
  background-repeat: no-repeat;
}

ul.headerMenuList li.findPayers a:hover img {
  visibility: hidden;
}

ul.headerMenuList li.news {
  background-image: url(/imgs/news_on.jpg);
  background-repeat: no-repeat;
}

ul.headerMenuList li.news a:hover img {
  visibility: hidden;
}

ul.headerMenuList li.educationalTools {
  background-image: url(/imgs/educationalTools_on.jpg);
  background-repeat: no-repeat;
}

ul.headerMenuList li.educationalTools a:hover img {
  visibility: hidden;
}
</pre>
<p>With the <a id="aptureLink_7nmqWMSjpx" href="http://ninjacss.com/blog/2009/06/30/javascript-image-swap-and-preload/">Javascript method</a> I previously posted, you have to preload the images. With this CSS method, you do not have to preload any images. The concept of this method is easy to grasp &#8211; you have an image and then you have a different image you want to reveal when you mouse over it. For people (like me) who don&#8217;t want to mess with Javascript, this is definitely a solid method!</p>
<p>Note: This method is not compatible with IE6 as it does not support attribute selectors (a:hover) nor context-dependent styles (a:hover img). <a id="aptureLink_7lLubqL4kH" href="http://ie6update.com/">To hell with IE6</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/07/16/css-image-swap/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javascript &#8211; image swap and preload</title>
		<link>http://ninjacss.com/blog/2009/06/30/javascript-image-swap-and-preload/</link>
		<comments>http://ninjacss.com/blog/2009/06/30/javascript-image-swap-and-preload/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 12:47:00 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[image swap]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=5</guid>
		<description><![CDATA[What You Want To Do: you have a menu of items or a set of images that need to change when they are hovered over. 
How To Do It: Use the MM Image Swap!
Put the following code between the &#60;head&#62; tags or a Javascript file that is called on whichever page(s) you want to swap [...]]]></description>
			<content:encoded><![CDATA[<p>What You Want To Do: you have a menu of items or a set of images that need to change when they are hovered over. </p>
<p>How To Do It: Use the MM Image Swap!</p>
<p>Put the following code between the &lt;head&gt; tags or a Javascript file that is called on whichever page(s) you want to swap images on.</p>
<pre class="brush: js">
<script type="text/javascript">
function MM_preloadImages() {
  var d=document; if(d.images){ 
    if (!d.MM_p) d.MM_p=new Array();
    var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for(i = 0; i < a.length; i++)
    if (a[i].indexOf("#")!= 0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i]; } }
}

function MM_swapImgRestore() {
  var i, x, a = document.MM_sr; for(i = 0; a &&amp; i <a.length &&amp; (x = a[i])&&amp;x.oSrc; i++) x.src=x.oSrc;
}

function MM_swapImage() {
  var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr=new Array; for(i = 0; i < (a.length-2); i += 3)
   if ((x=MM_findObj(a[i])) != null){document.MM_sr[j++] = x; if(!x.oSrc) x.oSrc=x.src; x.src= a [i+2]; }
}

function MM_findObj(n, d) {
  var p, i, x;  if(!d) d = document; 
  if ((p = n.indexOf("?")) > 0 &&amp; parent.frames.length) {
    d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);}
  if(!(x=d[n]) &&amp; d.all) x = d.all[n]; for (i = 0; !x &&amp; i < d.forms.length; i++) x = d.forms[i][n];
  for(i = 0; !x &&amp; d.layers &&amp; i < d.layers.length; i++) x=MM_findObj(n, d.layers[i].document);
  if(!x &&amp; d.getElementById) x=d.getElementById(n); return x;
}
</script>
</pre>
<p>Now, for the section that has the menu items (or images) that you want to swap, you  need to call the functions. The example I'm going to give is the menu list I used, so  adjust accordingly. If you didn't use a &lt;ul&gt; list, then don't copy my code exactly. Also, you'll need to swap out the image file names, height and width, etc. to your own.</p>
<pre class="brush: js">
<ul>
<li><a href="page1.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('image1','','home_on.jpg',1)"><img name="home" src="home.jpg" width="47" height="15" border="0" alt="Home"></a></li>
<li><a href="page2.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('createMap','','createMap_on.jpg',1)"><img src="createMap.jpg" width="95" height="15" border="0" name="createMap" alt="Create Map"></a></li>
<li><a href="page3.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('createTable','','createTable_on.jpg',1)"><img src="createTable.jpg" width="102" height="15" border="0" name="createTable" alt="Create Table"></a></li>
<li><a href="page4.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('dataDownloads','','dataDownloads_on.jpg',1)"><img src="dataDownloads.jpg" width="116" height="15" border="0" name="dataDownloads" alt="Data Downloads"></a></li>
<li><a href="page5.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('researchFindings','','researchFindings_on.jpg',1)"><img src="/researchFindings.jpg" width="114" height="15" border="0" name="researchFindings" alt="Research Findings"></a></li>
</ul>
</pre>
<p>Finally, go to the &lt;body&gt; tag and preload the images. Again, change the image file names to your own.</p>
<pre class="brush: js">
&lt;body onLoad="MM_preloadImages('home.jpg', 'home_on.jpg', 'createMap.jpg', 'createMap_on.jpg', 'createTable.jpg', 'createTable_on.jpg', 'dataDownloads.jpg', 'dataDownloads_on.jpg', 'researchFindings.jpg', 'researchFindings_on.jpg')"&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/06/30/javascript-image-swap-and-preload/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; overflow: hidden; FTW!</title>
		<link>http://ninjacss.com/blog/2009/06/29/css-overflow-hidden-ftw/</link>
		<comments>http://ninjacss.com/blog/2009/06/29/css-overflow-hidden-ftw/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 17:45:00 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[overflow hidden]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=4</guid>
		<description><![CDATA[The Problem: The outer container was not wrapping around some text. It was clear in my code that the text should be inside the area with the grey border.
The Solution: Use the style &#8220;overflow: hidden;&#8221;

The CSS looked like this:

.container {
border: 1px solid #cccccc;
border-top: none;
}

So then, I was like: SHAZAM! and used &#8220;overflow: hidden;&#8221; and here [...]]]></description>
			<content:encoded><![CDATA[<p>The Problem: The outer container was not wrapping around some text. It was clear in my code that the text should be inside the area with the grey border.</p>
<p>The Solution: Use the style &#8220;overflow: hidden;&#8221;</p>
<p><a href="http://4.bp.blogspot.com/_RxyyoQFlFLw/SkkAQdfvj4I/AAAAAAAAAOY/rQuY9xYEZJA/s1600-h/before.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5352809914902220674" style="display: block; margin: 0px auto 10px; text-align: center; cursor: hand; width: 400px; height: 136px; border: none;" src="http://4.bp.blogspot.com/_RxyyoQFlFLw/SkkAQdfvj4I/AAAAAAAAAOY/rQuY9xYEZJA/s400/before.jpg" border="0" alt="" /></a><br />
The CSS looked like this:</p>
<pre class="brush: css">
.container {
border: 1px solid #cccccc;
border-top: none;
}
</pre>
<p>So then, I was like: SHAZAM! and used &#8220;overflow: hidden;&#8221; and here is the result:</p>
<p><a href="http://2.bp.blogspot.com/_RxyyoQFlFLw/SkkAoKaO8DI/AAAAAAAAAOg/6_txcSI57RE/s1600-h/after.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5352810322095697970" style="display: block; margin: 0px auto 10px; text-align: center; cursor: hand; width: 400px; height: 138px; border: none;" src="http://2.bp.blogspot.com/_RxyyoQFlFLw/SkkAoKaO8DI/AAAAAAAAAOg/6_txcSI57RE/s400/after.jpg" border="0" alt="" /></a><br />
The CSS now looks like this:</p>
<pre class="brush: css">
.container {
border: 1px solid #cccccc;
border-top: none;
overflow: hidden;
}
</pre>
<p>Basically, whenever you have some type of content (image, text, div, anything!) that is outside of where it is supposed to be (like a container div), check that the code is correct. Check that there are proper opening/closing tags. If all else fails, try &#8220;overflow: hidden;&#8221; on the container div and it should do the trick!</p>
<p>乾杯!<br />
Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/06/29/css-overflow-hidden-ftw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://ninjacss.com/blog/2009/04/28/welcome/</link>
		<comments>http://ninjacss.com/blog/2009/04/28/welcome/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 16:04:00 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[miscellaneous]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=3</guid>
		<description><![CDATA[This is where I will put up HTML/CSS/Javascript issues I come across. If I have a solution to the problem, I will also post that. I&#8217;ll also write about anything I come across that might be seen as helpful or cool to a front-end web developer (aka ME).
]]></description>
			<content:encoded><![CDATA[<p>This is where I will put up HTML/CSS/Javascript issues I come across. If I have a solution to the problem, I will also post that. I&#8217;ll also write about anything I come across that might be seen as helpful or cool to a front-end web developer (aka ME).</p>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2009/04/28/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
