<?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 &#187; css</title>
	<atom:link href="http://ninjacss.com/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://ninjacss.com/blog</link>
	<description>html, css, javascript &#38; other stuff</description>
	<lastBuildDate>Tue, 17 Aug 2010 16:15:01 +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 links</title>
		<link>http://ninjacss.com/blog/2010/08/17/css-image-links/</link>
		<comments>http://ninjacss.com/blog/2010/08/17/css-image-links/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 16:15:01 +0000</pubDate>
		<dc:creator>Cindy</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://ninjacss.com/blog/?p=124</guid>
		<description><![CDATA[It depends on what’s going to be in the links themselves.  If the client wants full on images (including the text in the images), I’d usually just use an &#60;img&#62; with an &#60;a&#62; wrapped around it, as it’s simple and works in all browsers.
Alternatively, with the same tools, if I want to get tricky [...]]]></description>
			<content:encoded><![CDATA[<p>It depends on what’s going to be in the links themselves.  If the client wants full on images (including the text in the images), I’d usually just use an &lt;img&gt; with an &lt;a&gt; wrapped around it, as it’s simple and works in all browsers.</p>
<p>Alternatively, with the same tools, if I want to get tricky and keep as much as possible in the CSS (and I usually do), I prefer to set in an &lt;&gt; with the following css</p>
<pre class="brush: css">
Display:block;
Width:xxpx;
Height:xxpx;
Background-image:url(/blahblah/blah.png);
Background-repeat:no-repeat; (if applicable)
</pre>
<p>Doing the above allows for easy image swapping, hovers, etc and should work in all browsers as well.</p>
<p>If we have more free reign, and the fonts are web standard, then I would do something similar to the above, but the background image would only be the icon.  Going straight off my crazy-morning brain without looking at an editor… something like you have below might look like this:</p>
<pre class="brush: css">
.KEDUfacebook {
Padding:5px 5px 5px 35px;
Border:1px solid #color;
Line-height:15px;
Font-size:15px;
Font-family:whatever web standard font they’re using;
Background-image:url(/images/facebook-icon.png);
Background-repeat:no-repeat;
Background-position:5px 5px;
Display:block;
Height:xxpx;
}
</pre>
<p>This would be the HTML:</p>
<pre class="brush: html"><a href=”link” target=”_blank” class=”KEDUfacebook”>KaiserEDU on Facebook</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://ninjacss.com/blog/2010/08/17/css-image-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>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>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>
	</channel>
</rss>
