<?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>jc-designs.net &#187; CSS</title>
	<atom:link href="http://jc-designs.net/blog/category/web-development/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://jc-designs.net/blog</link>
	<description>jc-designs blog</description>
	<lastBuildDate>Thu, 09 Sep 2010 03:27:31 +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>The Poor Man&#8217;s CSS3 Button</title>
		<link>http://jc-designs.net/blog/2010/09/the-poor-mans-css3-button/</link>
		<comments>http://jc-designs.net/blog/2010/09/the-poor-mans-css3-button/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 19:18:50 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=534</guid>
		<description><![CDATA[I call them Pez
I received a tweet the other day about these cool CSS3 buttons called BonBon Buttons. The site says they are named after the French word for candy, but after looking at them, they look like Pez to me. Hmmm&#8230;that is what I will call mine&#8230;Pez! Regardless they are very pretty. Even better, [...]]]></description>
			<content:encoded><![CDATA[<h3>I call them Pez</h3>
<p>I received a tweet the other day about these cool CSS3 buttons called <a href="http://lab.simurai.com/css/buttons/">BonBon Buttons</a>. The site says they are named after the French word for candy, but after looking at them, they look like Pez to me. Hmmm&#8230;that is what I will call mine&#8230;Pez! Regardless they are very pretty. Even better, the creator of them lists where it won&#8217;t work. He was just tooling around one day and made these buttons. Well, I decided to do the &#8220;poor man&#8217;s version&#8221; of those. And unlike the BonBon buttons, my Pez button will work in IE6 as long as you use <a href="http://css3pie.com/">CSS PIE</a>, with the exception of text-shadow, and the radial gradient. Those two properties don&#8217;t add all that much, and even without them they look good in IE.</p>
<p><span id="more-534"></span><br />
<a href="http://www.jc-designs.net/demo/button.html">View Demo</a></p>
<h3>Are there 4 tons of CSS involved?</h3>
<p>There is well over 100 lines of CSS in the BonBon version, so I wanted to reduce that amount to something close to manageable. It still looks good, but I had to cut a bunch  of stuff out. Here is a look at the actual CSS code for my button.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">a <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">relative</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">font-size</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">24px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">font-weight</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">bold</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">font-family</span><span style="color: #00AA00;color: #439AD0;">:</span> Arial<span style="color: #00AA00;color: #439AD0;">,</span> Helvetica<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #993333;color: #439AD0;">sans-serif</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#76A14B</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">text-decoration</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">none</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">text-align</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">center</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">25px</span> <span style="color: #933;">10px</span> <span style="color: #933;">25px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">25px</span> <span style="color: #933;">10px</span> <span style="color: #933;">25px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">25px</span> <span style="color: #933;">10px</span> <span style="color: #933;">25px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">border</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">2px</span> <span style="color: #993333;color: #439AD0;">solid</span> <span style="color: #cc00cc;">#BFE599</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">padding</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">20px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">display</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">block</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #993333;color: #439AD0;">auto</span><span style="color: #00AA00;color: #439AD0;">;</span>
-moz-box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">6px</span> <span style="color: #933;">0px</span> <span style="color: #cc00cc;">#76a14b</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #933;">12px</span> <span style="color: #933;">9px</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">6px</span> <span style="color: #933;">0px</span> <span style="color: #cc00cc;">#76a14b</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #933;">12px</span> <span style="color: #933;">9px</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;color: #439AD0;">;</span>
box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">0px</span> <span style="color: #933;">6px</span> <span style="color: #933;">0px</span> <span style="color: #cc00cc;">#76a14b</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #933;">12px</span> <span style="color: #933;">9px</span> <span style="color: #cc00cc;">#666666</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">text-shadow</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">;</span>
behavior<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/PIE.htc</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #6666ff;color: #439AD0;">.glassy</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> -moz-radial-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #993333;color: #439AD0;">center</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">top</span> <span style="color: #00AA00;color: #439AD0;">,</span> ellipse farthest-corner<span style="color: #00AA00;color: #439AD0;">,</span> rgba<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0.7</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">0</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> rgba<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">100</span>%</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> -moz-linear-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc00cc;">#CCFF99</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc00cc;">#99CC66</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background-image</span><span style="color: #00AA00;color: #439AD0;">:</span> -webkit-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span>radial<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">100</span> <span style="color: #cc66cc;color: #439AD0;">100</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">32</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">118</span> <span style="color: #cc66cc;color: #439AD0;">118</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">15</span><span style="color: #00AA00;color: #439AD0;">,</span> from<span style="color: #00AA00;color: #439AD0;">&#40;</span>rgba<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">255</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> to<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> -webkit-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span>linear<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">0</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">0</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">0</span>%</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">100</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> from<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc00cc;">#CCFF99</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> to<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #cc00cc;">#99CC66</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
-pie-<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> linear-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc00cc;">#CCFF99</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc00cc;">#99CC66</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>The glassy part adds the background gradients as well as white radial gradient at the top of the button. So I reduced it down to like 30 lines of CSS for a pretty cool button.There are a few things to note:</p>
<p>1) As stated before, you MUST use CSS Pie for this to work in IE.</p>
<p>2) Ignore the webkit radial gradient, because I didn&#8217;t figure out how to do it correctly. Webkit&#8217;s syntax is a pain in the ass, so I just didn&#8217;t get it working correctly. If anyone wants to get that part done and post it, that would be great.</p>
<p>3) For IE6 to work, the &#8216;a&#8217; tag MUST be positioned relative. The effects get blow away if you do not.</p>
<h3>Final thoughts on this little experiment</h3>
<p>The really cool part for me about doing this, is that I&#8217;ve used two things/techniques from my previous posts. I&#8217;m using CSS Pie, and using multiple box-shadows on an element, which I wrote about <a href="http://jc-designs.net/blog/2010/08/css3-just-when-you-thought-you-knew-it-all/" target="_blank">here</a>.</p>
<p>I really like taking other people&#8217;s code, and seeing if I can do it with less code. Granted, here I am leaving some things out, but the overall effect comes through. My Pez button still looks like candy, and it didn&#8217;t take a vast amount of CSS to work. Would I use this button myself rather than cut images? Actually, with it pre-made, yes. If it wasn&#8217;t, then no. It took me a while to get everything the way I wanted it, and you just can&#8217;t waste that much creating a single button. So in production, I would have Sliced &#8216;n&#8217; Diced an image. Now, if you had a library of pre-made, small weight budget CSS3 buttons, then I might start using these types of things more often. Maybe I&#8217;ll start one and throw it out for you guys.</p>
<p>Take the code above and have fun with it. If you come up with something better, let me know!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=534" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/09/the-poor-mans-css3-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Positioning &#8211; Relative and Absolute</title>
		<link>http://jc-designs.net/blog/2010/09/css-positioning-relative-and-absolute/</link>
		<comments>http://jc-designs.net/blog/2010/09/css-positioning-relative-and-absolute/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 02:50:14 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=530</guid>
		<description><![CDATA[It takes all types
There are four types of positioning: static, fixed, relative, and absolute. Static is the default position state which means it isn&#8217;t positioned. It goes where it normally would on the page. Fixed is positioned relative to the browser window, and won&#8217;t move even if the window is scrolled. Relative positioning allows you [...]]]></description>
			<content:encoded><![CDATA[<h3>It takes all types</h3>
<p>There are four types of positioning: static, fixed, relative, and absolute. Static is the default position state which means it isn&#8217;t positioned. It goes where it normally would on the page. Fixed is positioned relative to the browser window, and won&#8217;t move even if the window is scrolled. Relative positioning allows you to use the top, right, bottom, and left CSS properties to position an element relative to where it would appear in the document. Absolute is the tricky one, because it is basically removed from the document, and placed EXACTLY where you want it to go.</p>
<h3>A note on :relative</h3>
<p>If you position something relative, and then use top and left to shift it over, don&#8217;t expect everything below it to shift as well. It still occupies the space in the document normally, you are just shifting it from its initial placement.</p>
<p><span id="more-530"></span></p>
<h3>Let&#8217;s take a look</h3>
<p><strong>View the following demos to get a clearer picture of what I am talking about</strong>.</p>
<p>When you position something absolute, you need to remember that it is removed from the flow of the document &#8211; everything else will ignore it. The element is positioned relative to the first parent element that has a position other than static, if there are none, it will use <html>. If that is the case, and you set the element&#8217;s top and left to 0, it will appear at the very top left edge of the window. No matter how you resize that window, that element will always be at the very top left. Take a look at what we would have.</p>
<p><a href="http://www.jc-designs.net/demo/position1.html">View Demo</a></p>
<p>Here is what the css looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #cc00cc;">#one</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">966px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">40px</span> <span style="color: #993333;color: #439AD0;">auto</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#two</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">absolute</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">left</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<h3>How to put it where you want it</h3>
<p>Let&#8217;s say though, that you want an element in a specific spot that shows exactly where you want it all the time. Easy. Position one of its parents to relative!</p>
<p><a href="http://www.jc-designs.net/demo/position2.html">View Demo</a></p>
<p>Here is what the css would look like:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #cc00cc;">#one</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">relative</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">966px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">40px</span> <span style="color: #993333;color: #439AD0;">auto</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#two</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">absolute</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">left</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>All that was changed, was adding position: relative to div #one, and changing the top and left numbers to div 2. Change them to 0 using Firebug, and you will see that 0 means positioned at the top left of div #one now.</p>
<h3>One is never enough</h3>
<p>Ooohhhh&#8230;I get it, you can&#8217;t just have one. You want another div there positioned absolutely. AND&#8230;you want this new div to appear under the red one.</p>
<p><a href="http://www.jc-designs.net/demo/position3.html">View Demo</a></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #cc00cc;">#one</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">relative</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">966px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">40px</span> <span style="color: #993333;color: #439AD0;">auto</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#two</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">absolute</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">left</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">z-index</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">2</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#three</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">position</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">absolute</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">top</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">85px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">left</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">550px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#999900</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>All I changed there, aside from adding the styles for div #three, is add z-index to div #two. It doesn&#8217;t matter what order the absoluted divs are in, just what z-index they have. Whichever element has the higher z-index, will show on top.</p>
<h3>Closing thoughts</h3>
<p>CSS positioning is actually very easy. Once you know how to use them, figuring out why an element isn&#8217;t positioned the way you thought it would be, becomes a lot easier, too. I can&#8217;t think of a time where I have used :fixed, but :relative and :absolute are thrown around enough that it is a must to learn if you haven&#8217;t yet. Hopefully now, you get a more clear picture of what they do, and how to control them! Let me know if you have any questions.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=530" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/09/css-positioning-relative-and-absolute/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 &#8211; Just When You Thought You Knew It All</title>
		<link>http://jc-designs.net/blog/2010/08/css3-just-when-you-thought-you-knew-it-all/</link>
		<comments>http://jc-designs.net/blog/2010/08/css3-just-when-you-thought-you-knew-it-all/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 03:09:30 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=520</guid>
		<description><![CDATA[You can do that?
So I read an article today that I thought was going to suck. Nope, I was wrong. While I knew most of it, there was one thing that popped out at me today. See? Learnin&#8217; all the time! CSS3 has some cool stuff that is easier to do than opening up Photoshop [...]]]></description>
			<content:encoded><![CDATA[<h3>You can do that?</h3>
<p>So I read an article today that I thought was going to suck. Nope, I was wrong. While I knew most of it, there was one thing that popped out at me today. See? Learnin&#8217; all the time! CSS3 has some cool stuff that is easier to do than opening up Photoshop and creating an image for it. If you got my tweet today, which most of my subscribers didn&#8217;t because you don&#8217;t follow me on twitter (<a href="http://twitter.com/jcDesig">FOLLOW ME!</a>), then you have an inkling of what I am talking about.</p>
<p><span id="more-520"></span><br />
Text-shadow is a really good addition to CSS, I use it on my titles and what-not, and with the use of blur on them, it creates a nice subtle effect. What I did NOT know, is that you can have multiple shadows on the text, adding more awesome to the already kick ass property. Let me show you what the styles look like.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">text-shadow</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">4px</span> <span style="color: #933;">-2px</span> <span style="color: #933;">11px</span> <span style="color: #cc00cc;">#0033FF</span><span style="color: #00AA00;color: #439AD0;">,</span>
	<span style="color: #933;">2px</span> <span style="color: #933;">-7px</span> <span style="color: #933;">10px</span> <span style="color: #cc00cc;">#00CCFF</span><span style="color: #00AA00;color: #439AD0;">,</span>
	<span style="color: #933;">5px</span> <span style="color: #933;">-8px</span> <span style="color: #933;">26px</span> <span style="color: #cc00cc;">#00CCCC</span><span style="color: #00AA00;color: #439AD0;">,</span>
	 <span style="color: #933;">4px</span> <span style="color: #933;">6px</span> <span style="color: #933;">9px</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;color: #439AD0;">;</span></pre></div></div>

<p><a href="http://www.jc-designs.net/demo/shadow.html">VIEW DEMO</a></p>
<h3>Yep! You read that right, there are 4 shadows going on there</h3>
<p>Holy hell, 4 text-shadows thrown on to create, while not a stellar looking effect, a crazy looking block of text. You know what is even more nuts than that? Can you guess? GOOD JOB! You guys are smarter than I thought, and you are right. You can add as many text-shadows as you want on that thing, seperated by commas. Not only that, but you can do the same thing for box shadows.</p>
<p>This just proves that there is always something new to learn about the things you think are are good at. Obviously I won&#8217;t be using this type of effect all that much, but it altered my way of thinking about CSS3 a little. If I can do this&#8230;maybe I can do something else that I didn&#8217;t think of. </p>
<p>Any other CSS3 stuff you guys know that others might not? Let us know here!</p>
<p>Oh, and I styled the demo buttons finally. Always adding stuff here.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>(:only-child)</strong><br />
This selector will get elements that are the only child of its parent. Below will get all &#8216;p&#8217; tags that are the only child of their parents.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'p:only-child'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'highlight'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=520" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/css3-just-when-you-thought-you-knew-it-all/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE6&#8217;s hasLayout and its margin issue</title>
		<link>http://jc-designs.net/blog/2010/08/ie6s-haslayout-and-its-margin-issue/</link>
		<comments>http://jc-designs.net/blog/2010/08/ie6s-haslayout-and-its-margin-issue/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 02:28:55 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[ie6]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=488</guid>
		<description><![CDATA[IE6 has bugs&#8230;let&#8217;s kill them
Everyone know how to fix the the double margin IE6 puts on an element that has a left/right margin on it, without using a hack? If not, it&#8217;s an easy one&#8230;set display to inline. That&#8217;s all it takes. Have you ever run into the 3px margin gap though? This took some [...]]]></description>
			<content:encoded><![CDATA[<h3>IE6 has bugs&#8230;let&#8217;s kill them</h3>
<p>Everyone know how to fix the the double margin IE6 puts on an element that has a left/right margin on it, without using a hack? If not, it&#8217;s an easy one&#8230;set display to inline. That&#8217;s all it takes. Have you ever run into the 3px margin gap though? This took some hunting for me to find out how to fix it. If you have any idea of what I&#8217;m talking about, you will know how infuriating it is. A co-worker and I ran into this problem months ago, figured out how to fix it, and forgot about it. The problem came back, and we drew a blank. Basically, we are using a component that says &#8220;Hey, if a flash banner is present, use it, otherwise, use this image over here instead.&#8221; Well, when it puts the image in, it doesn&#8217;t give it a height or a width. Why would that be a problem? Because it doesn&#8217;t have &#8216;Layout&#8217; according to IE.</p>
<h3>What does &#8216;hasLayout&#8217; mean?</h3>
<p>I&#8217;ll give you the definition that I got from <a href="http://www.satzansatz.de/cssd/onhavinglayout.html">here</a>: <em>“Layout” is an IE/Win proprietary concept that determines how elements draw and bound their content&#8230;&#8221;</em>.</p>
<p>I would like to be able to explain why this happens, but the link above does a better job of it than I ever could. I just want you aware of what happens. To better illustrate this, take a look at the link below in IE6.</p>
<p><a href="http://www.jc-designs.net/demo/hasLayout.html" target="_blank">Click here</a> for demo (again, look at it in IE6 &#8211; you won&#8217;t see it in any other browser).</p>
<p><span id="more-488"></span></p>
<p>I&#8217;ve read now a bunch of very bad ways to fix this, like using a negative top margin to move the bottom div up. Pure dumb, because there is an easy way to fix this. I&#8217;ve used zoom set to 1 before, but that doesn&#8217;t validate, so if you are one of the purest, this isn&#8217;t an option. Plus, this won&#8217;t work on this anyway. Real easy way to fix it. Give the image itself a display of block. Pure easy right? Now, I know most of you are not going to run into this problem, or maybe you just don&#8217;t care. I&#8217;m just demonstrating this so you are aware of it, and know how to fix it. It took me a while to figure out it had to be put on the image itself, and not the containing div. When using Spoon for Firefox, IE Developer kept showing text nodes underneath the image, so I was looking for a way to get rid of that. After about an hour of fiddling and trying everything I finally got it. And so do you now!</p>
<p>Let me know if you have come across any wierd IE bugs! I am always looking for stuff like that and how to fix them.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>$(&#8216;*&#8217;)</strong><br />
This will return all elements in the document, which I can&#8217;t think of a reason to do such a thing. But I can think of a reason to use this for something good. Below it change all the children of the element with an id of &#8216;container&#8217;, and give them the css property of color, set to black.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#container &gt; *'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'color'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #3366CC;color: #439AD0;">'#000000'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=488" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/ie6s-haslayout-and-its-margin-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Wish List &#8211; Div Shapes</title>
		<link>http://jc-designs.net/blog/2010/08/css-wish-list-plotting-div-points/</link>
		<comments>http://jc-designs.net/blog/2010/08/css-wish-list-plotting-div-points/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 03:23:57 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=474</guid>
		<description><![CDATA[Effects are cool, but come on, it could do more
Note: Comments have been disabled on this article due to an INSANE amount of spam ping comments. Must have been my title or something.
We can all agree that CSS3 added some really cool stuff. Linear gradients alone made it worthwhile for me. Add in border-radius, box/text-shadow, [...]]]></description>
			<content:encoded><![CDATA[<h3>Effects are cool, but come on, it could do more</h3>
<p><strong>Note: Comments have been disabled on this article due to an INSANE amount of spam ping comments. Must have been my title or something.</strong></p>
<p>We can all agree that CSS3 added some really cool stuff. Linear gradients alone made it worthwhile for me. Add in border-radius, box/text-shadow, transitions (available in FF 4 if you didn&#8217;t know yet) and whatever else I&#8217;m forgetting to mention, and you have a pretty good upgrade to CSS. Today though, while working on a site, I was frustrated by something that CSS can&#8217;t do. I Google&#8217;d the hell out of it, and I couldn&#8217;t even get the right topic to come up. It made me stop and think that, ya all those cool effects are great, but there are some things I would like it to do beyond that.</p>
<h3>Plotting Div Points</h3>
<p>I didn&#8217;t think of it until today. I work within a custom content management system that feeds default content into specific sections on the site. I want the main content block, I call a specific &#8216;id&#8217; on a div, and boom, it throws in some default content pertaining to whatever market I am building for. The problem though, is I can&#8217;t put a div/image/whatever into that content block, until after the site is ordered. Not a problem if I am building a custom site, because I have the ability to change that content. If I am building a template site though, I don&#8217;t have that ability because it has to fit any number of clients. What I needed today, was to wrap text around another div. See the image below and you will see what I mean.</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/cssDemands.jpg" alt="CSS Demands image" />
</div>
<p>NOTE: I think I am going to build this and sell the template here, so if you are interested, contact me!</p>
<p><span id="more-474"></span><br />
Easy stuff normally right? I&#8217;d put the div in the content wrapper, and float it right, then everything wraps around it. Done. Not in my case though, where I can&#8217;t inject further code into the default content. What I WANT CSS to be able to do, is allow me to plot the points of a div. In other words, I want to be able to control the shape of the div. The picture below shows what I want the div to look like.</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/cssDemands2.jpg" alt="CSS Demands image 2" />
</div>
<h3>What would the CSS look like?</h3>
<p>Now that you see the basic shape I was looking for, what would the CSS look like for something like that? Well, here is a crack at that:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.mainContent</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
border-points<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">200</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">200</span> <span style="color: #cc66cc;color: #439AD0;">200</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">200</span> <span style="color: #cc66cc;color: #439AD0;">400</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">400</span> <span style="color: #cc66cc;color: #439AD0;">400</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">400</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>What would all that mean though? Each two number set would plot a point for the div, so if you always start at the top left most corner, (top: 0, left: 0) you would tell the CSS where to plot each following points. In this case, the second point would be at 0px from the top, and 200 left of the starting point. The next would be 200 from the top, and 200 left. Then 200 from the top, and 400 left. And so forth until you completed the div again at 0 0.</p>
<p>But what if you wanted a circle?</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.mainContent</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
shape<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">circle</span><span style="color: #00AA00;color: #439AD0;">;</span>
shape-<span style="color: #000000; font-weight: bold;color: #439AD0;">size</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<h3>Where is my flying car?</h3>
<p>Obviously I&#8217;m coming up with the ridiculous CSS crap off the top of my head, but I think you understand what I am talking about. To me this is like the question &#8220;Why don&#8217;t we have flying cars yet?&#8221; CSS has been around a while, I would think it should be able to do some things like this. I don&#8217;t think it would cause to many issues with layout, that floats and proper math couldn&#8217;t handle. Now that you have read this, what do you think? Am I insane for expecting or wanting such a thing? Can you see a use for it? Seriously, imagine getting HTML text to wrap inside a circle or triangle shape? Some cool stuff could be done. </p>
<p>Do you have any CSS wish list items? Let me know, or tell me my idea is good or crap. Let&#8217;s talk!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.innerHeight();</strong><br />
This method will get the height for the <strong>first</strong> element in the set of matched elements (including padding, but NOT border). Below it would get the first div&#8217;s height in all that was matched (so height+padding = height returned).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.myClass div'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">innerHeight</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=474" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/css-wish-list-plotting-div-points/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS PIE: CSS3 styles for IE &#8211; easy to use and awesome</title>
		<link>http://jc-designs.net/blog/2010/08/css-pie-css3-styles-for-ie/</link>
		<comments>http://jc-designs.net/blog/2010/08/css-pie-css3-styles-for-ie/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 03:24:31 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=470</guid>
		<description><![CDATA[Flash back to&#8230;
A little while back I wrote an article about getting border-radius working in IE. Well, if you haven&#8217;t been keeping up in the blogging world, I came across CSS PIE. It basically does the same thing, only more. If you use things like box-shadow, linear-gradients, AND border-radius, then this is the version you [...]]]></description>
			<content:encoded><![CDATA[<h3>Flash back to&#8230;</h3>
<p>A little while back I wrote an article about <a href="http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/" target="_blank">getting border-radius working in IE</a>. Well, if you haven&#8217;t been keeping up in the blogging world, I came across CSS PIE. It basically does the same thing, only more. If you use things like box-shadow, linear-gradients, AND border-radius, then this is the version you will want to use. Basically the same call in the css file:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.myClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;color: #439AD0;">;</span>
border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;color: #439AD0;">;</span>
-moz-box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span>
box-shadow<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">5px</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span>
behavior<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">/PIE.htc</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p><span id="more-470"></span></p>
<p>The last line there is the obvious call to the htc file you have to download, which you can get <a href="http://github.com/lojjic/PIE/downloads">here</a>.</p>
<p><strong>A couple things to note:</strong><br />
1) Again, like the other one I talked about, the htc file is relative to the html file, NOT the css file. So either make it absolute from the domain root, OR, relative to the html file.<br />
2) There are issues with static positioning and background images, which you can also read about <a href="http://css3pie.com/documentation/known-issues/">here</a> (I had to find this out the hard way with the other version I used). Easy solution is to make the target have position set to relative.</p>
<p>Other than that, this works like a charm. Works on IE6-8. </p>
<h3>Conclusion</h3>
<p>Usually I am not so into these types of things because you have to add a script to make it work. Not so here, and I see no reason for not implementing this in all of my projects. All you have to do is upload the file to your server, and you are done. Well other than making all the behavior calls to it in the CSS file.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>$.merge();</strong><br />
This will merge the contents of two arrays together into the first array. So below, the two variables will be merged together, but uses a copy, so the original isn&#8217;t altered. You will get: ['Rocky', 'Better Off Dead', 'The Last Samurai', 'Goonies', 'Hangover', '40 Year Old Virgin']</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> myMovies1 <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900;color: #439AD0;">&#91;</span><span style="color: #3366CC;color: #439AD0;">'Rocky'</span><span style="color: #339933;color: #439AD0;">,</span><span style="color: #3366CC;color: #439AD0;">'Better Off Dead'</span><span style="color: #339933;color: #439AD0;">,</span><span style="color: #3366CC;color: #439AD0;">'The Last Samurai'</span><span style="color: #009900;color: #439AD0;">&#93;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #003366; font-weight: bold;color: #439AD0;">var</span> myMovies2 <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900;color: #439AD0;">&#91;</span><span style="color: #3366CC;color: #439AD0;">'Goonies'</span><span style="color: #339933;color: #439AD0;">,</span><span style="color: #3366CC;color: #439AD0;">'Hangover'</span><span style="color: #339933;color: #439AD0;">,</span><span style="color: #3366CC;color: #439AD0;">'40 Year Old Virgin'</span><span style="color: #009900;color: #439AD0;">&#93;</span><span style="color: #339933;color: #439AD0;">;</span>
$.<span style="color: #660066;">merge</span><span style="color: #009900;color: #439AD0;">&#40;</span> $.<span style="color: #660066;">merge</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#91;</span><span style="color: #009900;color: #439AD0;">&#93;</span><span style="color: #339933;color: #439AD0;">,</span>myMovies1<span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">,</span> myMovies2<span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=470" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/css-pie-css3-styles-for-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting border-radius to work in IE</title>
		<link>http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/</link>
		<comments>http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 07:37:02 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=450</guid>
		<description><![CDATA[Border-radius on IE? That is just crazy!
It&#8217;s funny how many things from my job come up as posts. Well, I guess not funny, because I end up working on things that I am not familiar with and have to fix. Which is the case tonight. I&#8217;m not sure if you have read any articles, but [...]]]></description>
			<content:encoded><![CDATA[<h3>Border-radius on IE? That is just crazy!</h3>
<p>It&#8217;s funny how many things from my job come up as posts. Well, I guess not funny, because I end up working on things that I am not familiar with and have to fix. Which is the case tonight. I&#8217;m not sure if you have read any articles, but there are plenty, about getting the CSS3 property border-radius to work in IE. It is actually rather easy, so let&#8217;s get to it, and I&#8217;ll show you how!<br />
Actually, I&#8217;ll tell you how. And then I&#8217;ll tell you some of the troubles I ran into.</p>
<h3>Wait, that&#8217;s it?</h3>
<p>So getting your rounded corners is pretty damn easy. There are three things you have to do:</p>
<p>1) Go <a href="http://www.htmlremix.com/css/curved-corner-border-radius-cross-browser">here</a> and download the htc file.<br />
2) Place the downloaded file in your images folder<br />
3) In your CSS file, on the style that you want the rounded corners you add something like this:</p>
<p><span id="more-450"></span></p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.roundedClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
-webkit-border-radius<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;color: #439AD0;">;</span>
behavior<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/border-radius.htc</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>This being the important part:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">behavior<span style="color: #00AA00;color: #439AD0;">:</span><span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">images/border-radius.htc</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span></pre></div></div>

<p>Where ever you are using the border-radius properties, you want the behavior added as well. Note that this does not work at all on anything in a form. So inputs, buttons, whatever&#8230;if it is in a form, I could not get this damn thing to work. Also, make the path in the behavior line relative to the document NOT the CSS file. Got it? If for instance, the .htc file is in the images folder and you are dealing with a root level document, then it would be images/border-radius.htc. If you have any questions about this, post a question in the comments section.</p>
<h3>IE8 is not very nice &#8211; pay attention here!</h3>
<p>I learned something while doing this. IE8.0.6 and IE8.0.76 handle this differently. First, the element with this property on it should be positioned to relative. If you have text on top of it, then that will have to be wrapped in something and also positioned relative. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div class=&quot;roundedClass&quot;&gt;&lt;p class=&quot;textClass&quot;&gt;This is the text that goes on top of the rounded corners div&lt;/p&gt;&lt;/div&gt;</pre></div></div>

<p>If you did this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div class=&quot;roundedClass&quot;&gt;This is the text that goes on top of the rounded corners div&lt;/div&gt;</pre></div></div>

<p>Then IE8.0.76 doesn&#8217;t play nice. IE8.06 however will work fine. I have NO idea why, but that is how it is.</p>
<h3>To conclude</h3>
<p>Have two wrappers (elements)&#8230;both positioned relative, the outer has the behavior and border-radius properties. Piece of cake. This works in IE6-8, and once I figured out the two wrappers and position relative thing, everything worked beautifully. Again, if you are still confused, ask away!</p>
<p>I will leave you with a quick tip. If you have multiple tabs open in IE8, press ctrl+q. It will show all the tabs you have open in one window, which you can then pick the one you want to view. Works kind of like Apple&#8217;s Expose. I wish I had known that a while back. It is actually a feature that they should have been promoting more. Especially considering that FF4 will have this feature now as well.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.detach();</strong><br />
This method will remove the matched elements from the DOM. Works kind of like .remove(), only that it keeps all the data associated with the removed elements in case you want to reinsert them back in later. So below would remove the unordered list from the element with an id of &#8216;wrapper&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#wrapper'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">detach</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'ul'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=450" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/getting-border-radius-to-work-in-ie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to control CSS3 Radial Gradients</title>
		<link>http://jc-designs.net/blog/2010/07/how-to-control-css3-radial-gradients/</link>
		<comments>http://jc-designs.net/blog/2010/07/how-to-control-css3-radial-gradients/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 07:04:15 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=401</guid>
		<description><![CDATA[Finally, something not so outrageous using CSS3 that we can all understand
I got a link through twitter about a raindrop done using CSS (don&#8217;t bother looking at this in Safari or Chrome, because he write the additional CSS for that). Normally this is the kind of thing that I will look at and say cool, [...]]]></description>
			<content:encoded><![CDATA[<h3>Finally, something not so outrageous using CSS3 that we can all understand</h3>
<p>I got a link through twitter about a <a href="http://mozilla.seanmartell.com/raindrop/">raindrop</a> done using CSS (don&#8217;t bother looking at this in Safari or Chrome, because he write the additional CSS for that). Normally this is the kind of thing that I will look at and say cool, but waste of time. This one caught my eye though because it is actually pretty simple. I&#8217;m not going to recreate the damn thing, but all it is, is a bunch of divs and a surprisingly small amount of CSS. I was actually impressed with this one, and I think it could have been done with just an ul and list items. Now, I would still use an image in a real life situation, but I picked this piece because I did not really know how to use the new gradients. This guy obviously does.</p>
<h3>Learnin&#8217;</h3>
<p>That led me to do some small bit of research and tests, and found it is not all that hard, just slightly confusing to get a grasp of what the numbers do. On top of that, the CSS Safari uses to do radial gradients is pretty different.</p>
<p>Some things to note about Safari while doing my demo. I could not get it to recognize percentages for the values in the border radius, so I had to do pixels. I&#8217;m not sure it can or not, and I didn&#8217;t find anything about it. Safari 5 does not <em>need</em> -webkit- in front of border-radius &#8211; it will still use it, so I would include it anyway to support the older versions. </p>
<p>If you look at the demo, you can see a div with a basic radial gradient, with rounded corners set to 100% in FF, and 300px in Safari. This should appear as a circle with red in the middle, then orange fading out to yellow. The second, is just to show you something easy to do with it. It is a png with the word GRADIENT cut out of it, and a drop shadow layer style put on. It then has a div behind it with a radial gradient, which if you ever wanted to change the colors, you wouldn&#8217;t have to use photoshop to do it. Just change the CSS!</p>
<p><a href="http://www.jc-designs.net/demo/radial.html" target="_blank">Click here for demo</a>.</p>
<p><span id="more-401"></span></p>
<h3>So how do you do it already?</h3>
<p>It took me a while to understand what all of the numbers meant, and how to move the gradient around. Using the image below, I&#8217;ll explain what each does in plain English. After reading it, the best way to really get a grasp of it is to mess with it in Firebug, adjusting the numbers.</p>
<p><img src="http://www.jc-designs.net/newimages/grad2.jpg" alt="Gradient CSS image" /></p>
<p><strong>Firefox:</strong><br />
A: This number, as it goes down, moves the center of the gradient left/right, while shrinking/increasing the amount of the center color displayed.<br />
B: Same as A, only top/bottom<br />
C: Adjusts the angle of the gradient, but in circle shape, this doesn&#8217;t do anything<br />
D: Shape of the gradient &#8211; This can be circle or ellipse<br />
E: Size of the gradient. This is like PS, where you can start and end your gradient at any point. This can be set to: closest-side, closest-corner, farthest-side, farthest-corner, contain (same as closest-side), and cover(same as farthest-corner)<br />
F: This is the center color of the gradient<br />
G: The color stop position &#8211; can be from 0 &#8211; 100%</p>
<p><strong>Safari:</strong><br />
A: This sets what type of gradient: linear or radial<br />
B: Moves the gradient left/right and top/bottom while keeping the center of the gradient in the middle (will look like a cone if you move the numbers far enough<br />
C: How much you are fading in or out the center color<br />
D: Moves the center of the gradient left/right and top/bottom while keeping the gradient in the middle<br />
E: How much of the center color that is solid (not faded out) &#8211; mess with this and you will see some cool stuff!<br />
F: The outer color<br />
G: The center color<br />
H: Think of this as the color between the outer and inner colors, and its percentage to show. Note you can do a very smooth gradient without F &#038; G, and only use a bunch of color-stops.</p>
<p>Here is the CSS I used for the circle:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	-moz-border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">100</span>%</span><span style="color: #00AA00;color: #439AD0;">;</span>
	border-radius<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">50px</span> <span style="color: #993333;color: #439AD0;">auto</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> 
		-moz-radial-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #933;">150px</span> <span style="color: #933;">150px</span> 0deg<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #993333;color: #439AD0;">circle</span> closest-side<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc00cc;">#ff0000</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">0</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> orange <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">50</span>%</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #993333;color: #439AD0;">yellow</span> <span style="color: #933;"><span style="color: #cc66cc;color: #439AD0;">100</span>%</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> 
		-webkit-gradient<span style="color: #00AA00;color: #439AD0;">&#40;</span>radial<span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">150</span> <span style="color: #cc66cc;color: #439AD0;">150</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">100</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">150</span> <span style="color: #cc66cc;color: #439AD0;">150</span><span style="color: #00AA00;color: #439AD0;">,</span> <span style="color: #cc66cc;color: #439AD0;">40</span><span style="color: #00AA00;color: #439AD0;">,</span> from<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #993333;color: #439AD0;">yellow</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> to<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #993333;color: #439AD0;">red</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">,</span> color-stop<span style="color: #00AA00;color: #439AD0;">&#40;</span>.4<span style="color: #00AA00;color: #439AD0;">,</span>orange<span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Take a look at the demo, copy the HTML and CSS, and start messing around. Once you start fiddling with it, everything will start to make sense. Hopefully my image and little lists helped you to understand CSS3 radial gradients better, and you get a clearer picture on controlling them. Now you can go and do some experimenting and come up with more raindrops.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.live();</strong><br />
This method attaches a handler to the event for every element that matches what you are searching for &#8211; currently or any added after the fact (which bind() does not do). Below, live() attaches a click event to anything with the class &#8216;touchThis&#8217;, including anything added later to the DOM with the same class.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.touchThis'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'click'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #003366; font-weight: bold;color: #439AD0;">function</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
<span style="color: #000066;color: #439AD0;">alert</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'You totally just touched that!'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #009900;color: #439AD0;">&#125;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=401" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/how-to-control-css3-radial-gradients/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Taking LESS.js for a spin, and how does it compare to Sass 3</title>
		<link>http://jc-designs.net/blog/2010/07/taking-less-js-for-a-spin-and-how-does-it-compare-to-sass-3/</link>
		<comments>http://jc-designs.net/blog/2010/07/taking-less-js-for-a-spin-and-how-does-it-compare-to-sass-3/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 04:16:57 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[LESS]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=384</guid>
		<description><![CDATA[What the hell is LESS?
If you have kept up with me, then hopefully you read my post on Sass 3. If not, well hopefully you are not out of the loop and have at least heard of it. This post is about LESS and LESS.js (which you can read about here). LESS used to be [...]]]></description>
			<content:encoded><![CDATA[<h3>What the hell is LESS?</h3>
<p><img src="http://www.jc-designs.net/newimages/less.jpg" alt="LESS logo" class="left" />If you have kept up with me, then hopefully you read my <a href="http://jc-designs.net/blog/2010/06/test-driving-sass-3-a-second-look-at-sass/" target="_blank">post on Sass 3</a>. If not, well hopefully you are not out of the loop and have at least heard of it. This post is about <a href="http://lesscss.org/">LESS</a> and LESS.js (which you can read about <a href="http://fadeyev.net/2010/06/19/lessjs-will-obsolete-css/">here</a>). LESS used to be a Ruby Gem install, not sure what that means exactly other than it is a pain the ass to install if you are not familiar with the command line.</p>
<p>There is a brilliant new way to actually use LESS, and that is to simply use javascript. Nothing to install, just include this line:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #339933;color: #439AD0;">&lt;</span>script src<span style="color: #339933;color: #439AD0;">=</span><span style="color: #3366CC;color: #439AD0;">&quot;http://lesscss.googlecode.com/files/less-1.0.18.min.js&quot;</span><span style="color: #339933;color: #439AD0;">&gt;&lt;/</span>script<span style="color: #339933;color: #439AD0;">&gt;</span></pre></div></div>

<p>You will also need a link to a LESS file, which will look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;link rel=&quot;stylesheet/less&quot; href=&quot;css/test.less&quot; type=&quot;text/css&quot; /&gt;</pre></div></div>

<p>A simple text file with a .less extension.</p>
<p>So what exactly is LESS? I would define it as a simplified and easier to use version of Sass. It incorporates the cool parts of Sass, such as variables, mixins and nested rules. Operations are also included, but I haven&#8217;t delved too deep into it yet. But a small test was all it took to see what I liked and disliked. First, lets take a look at the VERY basic page I did.</p>
<p><a href="http://jc-designs.net/demo/less.html" target="_blank">Click here</a> to see the demo.</p>
<p><span id="more-384"></span></p>
<p>Again, LESS does all the basic stuff Sass can do, only with slightly different syntax. For instance, when declaring a variable, you use the @ symbol instead of $. When doing Mixins, you do something like a class: .className(values go here), instead of the @mixin that Sass uses.</p>
<h3>Why it kicks ass</h3>
<p>Lets get on with what is good about LESS. First, it took me less time to learn LESS&#8230;hmm that is going to be annoying isn&#8217;t it? Anyway, less time to learn than Sass. Now keep in mind that I have already begun using Sass, so that could be a factor in how quickly I was able to pick it up. It&#8217;s not really all that hard to understand. If you know CSS well, then this is a twenty minute learning process, and probably only an hour to master. This is a huge plus in its favor.</p>
<p>Another would be the fact that they came out with a javascript version of it. All you need is that one line of javascript, and a text editor for creating the .less file. For a second dose of cool, add this after it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #339933;color: #439AD0;">&lt;</span>script type<span style="color: #339933;color: #439AD0;">=</span><span style="color: #3366CC;color: #439AD0;">&quot;text/javascript&quot;</span> charset<span style="color: #339933;color: #439AD0;">=</span><span style="color: #3366CC;color: #439AD0;">&quot;utf-8&quot;</span><span style="color: #339933;color: #439AD0;">&gt;</span>
    less.<span style="color: #660066;">env</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #3366CC;color: #439AD0;">&quot;development&quot;</span><span style="color: #339933;color: #439AD0;">;</span>
    less.<span style="color: #660066;">watch</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #339933;color: #439AD0;">&lt;/</span>script<span style="color: #339933;color: #439AD0;">&gt;</span></pre></div></div>

<p>This basically auto-refreshes the CSS whenever you save the .less file. You make a change to the file, save it, and freakin&#8217; BAM! the browser shows the update pretty much instantly, without having to refresh(this is for working locally). On top of that, if you make a mistake, you will know it big time, as it puts out a giant ass warning on top of the page. This makes it fast and easy to deal with. The only other thing I like, which is probably a huge plus if you are familiar with Sass, is that there is no manual compiling of the .less file.</p>
<p>Now what I personally don&#8217;t like about it. You were probably thinking this was just a ringing endorsement of a product, didn&#8217;t you? No, there are actually things I don&#8217;t like, and its difficult to say what others will say about them.</p>
<h3>Every rose has its thorn&#8230;or two</h3>
<p>One, take a look at my demo, check the source code, and click on the link to the .less file. What do you see? That&#8217;s right, not just plain old CSS. You actually see LESS, so if are unfamiliar with it, you will be asking yourself what all the crazy looking stuff is. I am not sure exactly why this bugs me, but it does. I just want to see the regular CSS output, not the LESS itself. This is opinion, so take it for what its worth. I&#8217;m just telling you what I personally don&#8217;t like, and what to expect.</p>
<p>Two, and notice that this is what I listed as one of its good points, is your CSS is now reliant on javascript. This above all else is the one factor that really bothers me. Where Sass is compiled ahead of time with the operation already over, LESS is doing it on the fly. Plus, while not big, if you are not using a minifier, you are adding http requests just to make your CSS work. I also have NO idea if LESS plays well with other javascript libraries such as jQuery or Ext (if ANYONE can answer that, I would HUGELY appreciate it).</p>
<h3>Let&#8217;s wrap it up</h3>
<p>After trying both LESS.js and Sass 3 now, I will say that at the moment I favor Sass 3. I prefer the mixin syntax even though it is longer, for the simple fact that I can spot them a mile a way. In LESS they can look like a class if you are not paying attention. I also prefer the $ method of calling a variable because I am familiar with jQuery, and the symbol is recognizable for me. LESS.js gets the advantage points in not having to install anything, ease of getting started, and no manual compiling, but ultimately scares me with having to rely on javascript for my CSS, and not knowing for sure how it behaves with other js libraries. </p>
<p>The article I linked to in the beginning of this post, about making CSS obsolete is jumping the gun way to early. I will agree that LESS.js is pretty damn cool, but it&#8217;s requiring people to learn something on top of CSS, which they might not have a terrific grasp of yet anyway. Will people use it? Yes. Will a LOT of people use it, to the point of taking over just plain old CSS? No, not in my opinion. But I would love to see this kind of thing incorporated into CSS, and its a shame that CSS3 doesn&#8217;t. I would almost rather have these types of advances in CSS, than being able to add a drop shadow or a rounded border. Almost.</p>
<p>For now&#8230;I&#8217;m still sticking with Sass 3.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.select();</strong><br />
This event method will bind and event handler to the select() event, or trigger that event on an element. Below, when any part of the text is selected it will send an alert.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#myID'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">select</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #003366; font-weight: bold;color: #439AD0;">function</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
<span style="color: #000066;color: #439AD0;">alert</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">&quot;Do not select this text again, or you will be sorry!&quot;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #009900;color: #439AD0;">&#125;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=384" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/taking-less-js-for-a-spin-and-how-does-it-compare-to-sass-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; Hacking the hell out of browsers</title>
		<link>http://jc-designs.net/blog/2010/06/css-hacking-the-hell-out-of-browsers/</link>
		<comments>http://jc-designs.net/blog/2010/06/css-hacking-the-hell-out-of-browsers/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 04:13:45 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=380</guid>
		<description><![CDATA[I&#8217;ve done small posts when I started doing this blog a while back, that included tips on how to hack certain browsers with CSS. I thought it would be good to list them all in one spot. I have been thinking of writing a small e-book that included all the things I have learned that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done small posts when I started doing this blog a while back, that included tips on how to hack certain browsers with CSS. I thought it would be good to list them all in one spot. I have been thinking of writing a small e-book that included all the things I have learned that I wish I knew from the start. Kind of like a super crash course in web development. Most of the things I write about, are things that would have been useful to me when I started out, but took a lot of time using google, reading, and just plain trial and error. I like to think I&#8217;m helping new web developers/designers get a kick start in their learning, and get ahead of the curve, which is what keeps me going. I actually really like mentoring new to intermediate web devs, and that is what keeps me writing this blog. Besides that, I actually end up learning more myself.</p>
<p>There are things that have to be done to make sure your site works in all browsers, and sometimes that means you have to do some things in your CSS to make sure everything is nice. I am going to show you the major methods of how to what we call &#8220;hack&#8221; a css file so that the browsers display the same thing. Let it be known, that it took me a while to be able to design a site without worrying about IE6. At the start, concepts of float, how margins and padding work, and other such things can be very confusing. I did a lot of hacking in the beginning before I knew how to build a site correctly. It would be great if you could just write the CSS and it all worked perfect, but even now, every once in a while, you have to do some fiddly things to get the older IE&#8217;s to cooperate. Let it be known, that I use the IE6 one quite a bit for image replacement, and if you do use these, you actually should put them in a seperate IE stylesheet. For getting things up and running quick though, I keep them in the main CSS file until I am done, and then take them out.</p>
<p>Now onto hacking!</p>
<p><span id="more-380"></span></p>
<p>First up, is how to hack the different IE&#8217;s. Here are the major four:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.myText1</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#00FF33</span><span style="color: #00AA00;color: #439AD0;">;</span> <span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #6666ff;color: #439AD0;">.myText2</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span> <span style="color: #808080; font-style: italic;color: #439AD0;">/*\**/</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#cc0000</span>\<span style="color: #cc66cc;color: #439AD0;">9</span><span style="color: #00AA00;color: #439AD0;">;</span> <span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #6666ff;color: #439AD0;">.myText3</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#0000ff</span> !ie<span style="color: #00AA00;color: #439AD0;">;</span> <span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #6666ff;color: #439AD0;">.myText4</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span> _color<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span> <span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Or, all in one style like so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.myText1</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#00FF33</span><span style="color: #00AA00;color: #439AD0;">;</span> 
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span> <span style="color: #808080; font-style: italic;color: #439AD0;">/*\**/</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#cc0000</span>\<span style="color: #cc66cc;color: #439AD0;">9</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#0000ff</span> !ie<span style="color: #00AA00;color: #439AD0;">;</span>
 _color<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;color: #439AD0;">;</span> 
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>So what do these do? Glad you asked! If you want, you can copy these styles, and test them yourself.</p>
<p>Line 1) Obviously targets all browsers. This is just a plain style. Nothing special here.<br />
Line 2) Will only target IE7 &#038; 8 (but not IE6)<br />
Line 3) Will only target IE7 &#038; 6<br />
Line 4) Will only target IE6</p>
<p>All of these styles together will get you this effect (try it out if you don&#8217;t believe me): All browsers other than IE, will get green text. IE8 will get dark red text, IE7 will get blue, and IE6 will get black.  Its crazy, I know, but still kind of cool. That is great and all, but what if Safari is giving you a problem? Well, that is pretty unlikely. But just in case, here is how you hack the CSS for it, just in case.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.myClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">20px</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
&nbsp;
<span style="color: #a1a100;color: #439AD0;">@media screen and (-webkit-min-device-pixel-ratio:0) {</span>
<span style="color: #6666ff;color: #439AD0;">.myClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">0px</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>I have no idea why you would need to margin something from the top differently in Safari, I&#8217;m just using something easy to understand in that regard. That second part of the code though would change the margin for Apple&#8217;s little darling. Unfortunately, from the tests I tried, it looks like you need another @media for each CSS rule. Sucks, but at least you know how to do it now.</p>
<p>And of course, what if you had to overwrite an inline style? Suppose you had this HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div style=&quot;background: red;&quot;&gt;The inline styles for this div should make it red.&lt;/div&gt;</pre></div></div>

<p>You can fight that with this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">div<span style="color: #00AA00;color: #439AD0;">&#91;</span>style<span style="color: #00AA00;color: #439AD0;">&#93;</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>   <span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">yellow</span> !important<span style="color: #00AA00;color: #439AD0;">;</span> <span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>I have never had the need to do that, but just in case you do, there you go. Just because I can&#8217;t think of a reason to actually do that, doesn&#8217;t mean no one else will. I only know it because I thought I was being cornered into using it, and had to search for a way.</p>
<p>I really only use one of these, and that is the one for IE6. Here is what I use it for mostly:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.myClass</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">background</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">../images/myImage.png</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #993333;color: #439AD0;">no-repeat</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;color: #439AD0;">;</span>
_background<span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #993333;color: #439AD0;">url</span><span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000; font-style: italic;">../images/myImage.gif</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #993333;color: #439AD0;">no-repeat</span> <span style="color: #933;">0px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>I know I can use a png replacement script, but this is easier sometimes. IE6 gets a fair image, though not perfect, but it is at a suitable level of graceful degrading. If you want to see that in action, take a look at this blog in IE6. All the pngs are actually gifs in IE6, put in place using rules like the one above.</p>
<p>I have given you the ones I have had a need to know at one point or other. What hacks have you used?</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.load();</strong><br />
This method will load data from the server and place the returned HTML into the matched element. Below, it will load the HTML from a file called newText.html in an element with an id of &#8216;myDiv&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'#myDiv'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">load</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'newText.html'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=380" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/06/css-hacking-the-hell-out-of-browsers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
