<?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>bavotasan.com &#187; use</title>
	<atom:link href="http://bavotasan.com/tag/use/feed/" rel="self" type="application/rss+xml" />
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:42:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>6 Tips to Speed Up jQuery</title>
		<link>http://bavotasan.com/2010/tips-speed-up-jquery/</link>
		<comments>http://bavotasan.com/2010/tips-speed-up-jquery/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 16:10:12 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[attr]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[fff]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Location]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[Properties]]></category>
		<category><![CDATA[selector]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2518</guid>
		<description><![CDATA[As it stands, jQuery is an amazingly efficient JavaScript framework, but there are a few things that you can do when creating your code that will end up slowing it down significantly. I&#8217;ve noticed that a few small changes to my standard way of using jQuery have made my code run a lot faster. 1. [...]]]></description>
			<content:encoded><![CDATA[<p>As it stands, <a href="http://jquery.com/">jQuery</a> is an amazingly efficient JavaScript framework, but there are a few things that you can do when creating your code that will end up slowing it down significantly. I&#8217;ve noticed that a few small changes to my standard way of using <a href="http://jquery.com/">jQuery</a> have made my code run a lot faster.</p>
<h3>1. Be More Specific with Selectors</h3>
<p>When you are setting up <a href="http://jquery.com/">jQuery</a> to search through the DOM for a specific element, the more information you give it, the faster it will find the element. It is also faster to use IDs instead of classes.</p>
<p>Something like this will require going through the whole DOM structure to find the element:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.item&quot;</span><span style="color: #009900;">&#41;</span></pre></div></td></tr></table></div>

<p>These are way more efficient:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// use IDs instead of Classes</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p.first .item&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #006600; font-style: italic;">// be more specific with the location</span></pre></div></td></tr></table></div>

<h3>2. Always Use $(this)  </h3>
<p>If you are using a selector to traverse the DOM in search of an element to perform a specific function on, that element becomes stored and can be manipulated within the function by using <code>$(this)</code>.</p>
<p>This code will traverse the DOM twice to get the same element:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>This is the efficient way since the element is already stored within the <code>$(this)</code> call:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#item&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'clicked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>3. Pass Multiple Selectors</h3>
<p>If you want the same functions to occur on multiple elements, it is possible to group selectors together to increase performance and avoid repetitive traversing of the DOM.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// bad</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#two&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#three&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// good</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p#one, p#two, p#three&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>4. Use Multiple Properties and Values</h3>
<p>Many <a href="http://jquery.com/">jQuery</a> methods accept multiple properties and values instead of just a single property and value pair. Including multiple properties will help speeds things up as it reduces the amount of <a href="http://jquery.com/">jQuery</a> objects that are created within your code.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// bad</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'src'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'http://mysite.com/images/image.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'alt'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'My Image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// good</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img#one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #3366CC;">'src'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://mysite.com/images/image.jpg'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'alt'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'My Image'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>5. Add Styles with Classes or IDs</h3>
<p>If you want to add multiple style changes to an element, it make more sense to use CSS to assign your styles to a Class or ID, and then add that Class or ID to the element. </p>
<p>Create your styles:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
.<span style="color: #993333;">faster</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#dd0000</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">8px</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>And instead of doing this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #3366CC;">'background'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'#dd0000'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'color'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'#fff'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'padding'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'5px 8px'</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Do this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;p&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;faster&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<h3>6. Use Chaining</h3>
<p>Once you have already selected an element, you can chain your commands using <code>.end()</code> instead of traversing the DOM multiple times to find the same element. Understanding chaining might take a bit of trial and error to really get the hang of it. Certain commands require that you <code>.end()</code> the chain and certain don&#8217;t. I&#8217;ll give more in depth tutorial on chaining in the future to help guide you through the ins and outs of it all.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//bad</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div p.one&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div p.two&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlight'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>


<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//good</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p.one'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">slideDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'p.two'</span><span style="color: #009900;">&#41;</span>
  .<span style="color: #660066;">addClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'highlight'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>These are just a few things that have helped me make my <a href="http://jquery.com/">jQuery</a> code run more efficiently. There are tons of books and resources out there that can help you take it to the next level to create the most efficient <a href="http://jquery.com/">jQuery</a> code imaginable. Here are a few I suggest:</p>
<ul>
<li><a href="http://jqueryenlightenment.com/">jQuery Enlightenment by Cody Lindley</a></li>
<li><a href="http://www.learningjquery.com/">Learning jQuery</a></li>
<li><a href="http://jqueryfordesigners.com/">jQuery for Designers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/tips-speed-up-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The New Google Font API</title>
		<link>http://bavotasan.com/2010/google-font-api/</link>
		<comments>http://bavotasan.com/2010/google-font-api/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:55:04 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Css File]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[face kits]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[head tags]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[look]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[serif]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2074</guid>
		<description><![CDATA[Using the standard Web safe fonts is quickly becoming a thing of the past thanks to modern alternatives like @font-face kits and the new Google Font API. Taking a quick look through the Getting Started guide shows just how simple it is to apply the API to your Web site. All you have to do [...]]]></description>
			<content:encoded><![CDATA[<p>Using the standard Web safe fonts is quickly becoming a thing of the past thanks to modern alternatives like @font-face kits and the new <a href="http://code.google.com/apis/webfonts/">Google Font API</a>.  Taking a quick look through the <a href="http://code.google.com/apis/webfonts/docs/getting_started.html">Getting Started</a> guide shows just how simple it is to apply the API to your Web site. All you have to do is add a link between your site&#8217;s head tags to the CSS file hosted on Google, and then you can call the chosen font throughout your stylesheet.<br />
<span id="more-2074"></span><br />
Here is an example of the link:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://fonts.googleapis.com/css?family=Tangerine&quot;</span><span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Then you can use the font like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;style<span style="color: #00AA00;">&gt;</span>
      body <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'Tangerine'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">48px</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>Check out a list of available font in the <a href="http://code.google.com/webfonts">font directory</a>. They are all licensed for commercial and non-commercial use.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/google-font-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Embedding Fonts in your Web Site with CSS and @font-face</title>
		<link>http://bavotasan.com/2010/embedding-fonts-web-site-css-font-face/</link>
		<comments>http://bavotasan.com/2010/embedding-fonts-web-site-css-font-face/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 20:19:23 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[everything]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[Paragraph]]></category>
		<category><![CDATA[Squirrel]]></category>
		<category><![CDATA[Style]]></category>
		<category><![CDATA[Upload]]></category>
		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1671</guid>
		<description><![CDATA[One of the winners of a free copy of Magazine Premium (see this article) suggested implementing @font-face kits to the theme. I had read about @font-face but never actually attempted to use it before. I did a bit more research and finally figured it out. Now 10 @font-face kits are available with Magazine Premium and [...]]]></description>
			<content:encoded><![CDATA[<p>One of the winners of a free copy of Magazine Premium (<a href="http://bavotasan.com/?p=1634">see this article</a>) suggested implementing @font-face kits to the theme. I had read about @font-face but never actually attempted to use it before. I did a bit more research and finally figured it out. Now 10 @font-face kits are available with Magazine Premium and I thought it would be a good idea to show you how I did it.<br />
<span id="more-1671"></span><br />
Adding @font-face fonts to your Web site is not that difficult. It just takes a few steps.</p>
<p>First, you need to download some @font-face kits. I like to use kits supplied by <a href="http://www.fontsquirrel.com/fontface">Font Squirrel</a> because they have an awesome library and all their fonts are 100% free for commercial use. For this example I&#8217;m going to use <a href="http://www.fontsquirrel.com/fonts/Riesling">Riesling</a>.</p>
<p>Once you have the files downloaded you need to add them to your Web site. Create a folder named &#8220;fonts&#8221; and place the riesling.eot and riesling.ttf files into the folder. Upload that to your site, in to the same directory as your style sheet.</p>
<p>Now open your style sheet and add the following:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
 *
 * The fonts included are copyrighted by the vendor listed below.
 *
 * @vendor:     Bright Ideas
 * @licenseurl: http://www.fontsquirrel.com/license/Riesling
 *
 *
 */</span>
&nbsp;
<span style="color: #a1a100;">@font-face {</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'RieslingRegular'</span><span style="color: #00AA00;">;</span>
	src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'fonts/riesling.eot'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
	src<span style="color: #00AA00;">:</span> local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'Riesling Regular'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'Riesling'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'fonts/riesling.ttf'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'truetype'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Everything is in place for you to use Riesling as a font on your Web site. Just add it to your CSS like you would any other font-family:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">h1 <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'RieslingRegular'</span><span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>The one thing you need to realize when using @font-face kits is that only modern browsers recognize it. </p>
<style type="text/css">
@font-face {
	font-family: 'RieslingRegular';
	src: url('http://bavotasan.com/fonts/riesling.eot');
	src: local('Riesling Regular'), local('Riesling'), url('http://bavotasan.com/fonts/riesling.ttf') format('truetype');
}
p.riesling {font: 26px/28px 'RieslingRegular', Arial, sans-serif;}
</style>
<p class="riesling">
This is a sample paragraph that uses @font-face kits and CSS. If you see this paragraph in Riesling then your browser supports @font-face. If not, you might need to upgrade your browser to take advantage of @font-face kits.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/embedding-fonts-web-site-css-font-face/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
		<item>
		<title>Find the Category ID using the Category Slug in WordPress</title>
		<link>http://bavotasan.com/2009/find-the-category-id-using-the-category-slug-in-wordpress/</link>
		<comments>http://bavotasan.com/2009/find-the-category-id-using-the-category-slug-in-wordpress/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 17:40:52 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[category id]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[none]]></category>
		<category><![CDATA[OBJECT]]></category>
		<category><![CDATA[piece]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[slug]]></category>
		<category><![CDATA[something]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[value]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1610</guid>
		<description><![CDATA[This is a quick little piece of code that I have been using a lot lately. I needed to get the category ID but all I had to work with was the category slug. Luckily WordPress has a neat little function called get_term_by() which makes it super easy. The function can be used to get [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick little piece of code that I have been using a lot lately. I needed to get the category ID but all I had to work with was the category slug. Luckily WordPress has a neat little function called <code>get_term_by()</code> which makes it super easy. The function can be used to get a lot more information but for this example I am just going to extract the ID.<br />
<span id="more-1610"></span><br />
The function works like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_term_by<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$field</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #339933;">,</span> <span style="color: #000088;">$taxonomy</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$filter</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p><strong>$field</strong>: (string) (required) Either &#8216;slug&#8217;, &#8216;name&#8217;, or &#8216;id&#8217;. Default: None<br />
<strong>$value</strong>: (string|integer) (required) Search for this term value. Default: None<br />
<strong>$taxonomy</strong>: (string) (required) Taxonomy Name. Default: None<br />
<strong>$output</strong>: (string) (optional) Constant OBJECT, ARRAY_A, or ARRAY_N. Default: OBJECT<br />
<strong>$filter</strong>: (string) (optional) default is raw or no WordPress defined filter will applied. Default: &#8216;raw&#8217; </p>
<p>We are going to use it like this to get the ID with the category slug &#8216;tutorials&#8217;:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #000088;">$theCatId</span> <span style="color: #339933;">=</span> get_term_by<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'slug'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tutorials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'category'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$theCatId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$theCatId</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">term_id</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>If you insert a <code>print_r()</code> function you can echo out all the information that the <code>get_term_by()</code> function contains. Use something like this and see if there is other information that you might want to extract:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #000088;">$theCatId</span> <span style="color: #339933;">=</span> get_term_by<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'slug'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tutorials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'category'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$theCatId</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>Then all you would have to do is use whichever term your see between those square brackets like so:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #000088;">$theCatId</span> <span style="color: #339933;">=</span> get_term_by<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'slug'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'tutorials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'category'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$theCatId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$theCatId</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">description</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/find-the-category-id-using-the-category-slug-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Digging Into WordPress Book Now Available</title>
		<link>http://bavotasan.com/2009/digging-into-wordpress-book-now-available/</link>
		<comments>http://bavotasan.com/2009/digging-into-wordpress-book-now-available/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 19:24:26 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[anyone]]></category>
		<category><![CDATA[BOOK]]></category>
		<category><![CDATA[cart]]></category>
		<category><![CDATA[Chris Coyier]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[DIGGING]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[fan]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[support]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1499</guid>
		<description><![CDATA[Anyone who visits my site can see that I am a huge fan of WordPress. I do my best to contribute back to the WP community and support others who are doing the same. I just got my hands on a copy of Chris Coyier and Jeff Starr&#8217;s Digging Into WordPress book and I find [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.e-junkie.com/ecom/gb.php?cl=88539&#038;c=ib&#038;aff=93121"><img src="http://bavotasan.com/wp-content/uploads/2009/11/cover-diw.jpg" alt="cover-diw" title="cover-diw" width="200" height="150" class="alignright size-full wp-image-1500" /></a>Anyone who visits my site can see that I am a huge fan of <a href="http://wordpress.org">WordPress</a>. I do my best to contribute back to the WP community and support others who are doing the same. I just got my hands on a copy of Chris Coyier and Jeff Starr&#8217;s <a href="https://www.e-junkie.com/ecom/gb.php?cl=88539&#038;c=ib&#038;aff=93121">Digging Into WordPress</a> book and I find it an amazing resource for anyone interested in starting a Web site using WordPress.<br />
<span id="more-1499"></span><br />
The book is currently available as a digital download (PDF) for $27 USD. Use the coupon code DIWEARLY in the cart to save $5. That coupon is only valid until the 21st of November. </p>
<p>Purchasing the book now will give you a lifetime subscription to all future updates. If you want to check out a sample, the Table of Contents and part of Chapter Three is available through <a href="http://css-tricks.com/pdfs/Digging-Into-WP-DEMO.pdf">this link</a>.</p>
<p>Check out the <a href="https://www.e-junkie.com/ecom/gb.php?cl=88539&#038;c=ib&#038;aff=93121">official site</a> for more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/digging-into-wordpress-book-now-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Win a One-Year Subscription to Layers Magazine</title>
		<link>http://bavotasan.com/2009/win-a-one-year-subscription-to-layers-magazine/</link>
		<comments>http://bavotasan.com/2009/win-a-one-year-subscription-to-layers-magazine/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 19:08:53 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[Canada]]></category>
		<category><![CDATA[canada and the united states]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[everything]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[lot]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[month]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[October]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[trackback]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[Whole Lot]]></category>
		<category><![CDATA[Win]]></category>
		<category><![CDATA[winner]]></category>
		<category><![CDATA[Year]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1241</guid>
		<description><![CDATA[October is here and that means it&#8217;s time for another contest. This month I will be giving away a one-year subscription to Layers Magazine. For those who have never heard of Layers Magazine, it is the #1 how-to magazine for everything Adobe. Each issue features tutorials, reviews, designer inteviews and a whole lot more. To [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bavotasan.com/wp-content/uploads/2009/10/layers.jpg" alt="layers" title="layers" width="300" height="216" class="alignright size-full wp-image-1242" />October is here and that means it&#8217;s time for another contest. This month I will be giving away a one-year subscription to <a href="http://www.layersmagazine.com/">Layers Magazine</a>. For those who have never heard of <a href="http://www.layersmagazine.com/">Layers Magazine</a>, it is the #1 how-to magazine for everything Adobe. Each issue features tutorials, reviews, designer inteviews and a whole lot more. To win a one-year subscription, all you need to do is link to this post on your site. It is as simple as that.<br />
<span id="more-1241"></span><br />
Just create your own link to this article or use the following code:</p>
<div class="sections">
<pre>
&lt;a href='http://bavotasan.com/articles/win-a-one-year-subscription-to-layers-magazine/' title='Win a One-Year Subscription to Layers Magazine'&gt;Win a One-Year Subscription to Layers Magazine&lt;/a&gt;</pre>
</div>
<p>On November 1st, 2009, I will randomly select a trackback and award the winner a one-year subscription to <a href="http://www.layersmagazine.com/">Layers Magazine</a>.</p>
<p><small>This contest is only open to residents of Canada and the United States. The winner will be contacted through their Web site on November 1st, 2009. Contest ends October 31st at 11:59pm.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/win-a-one-year-subscription-to-layers-magazine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clearing the &lt;hr /&gt; Tag with CSS That Works in IE</title>
		<link>http://bavotasan.com/2009/clearing-the-hr-tag-with-css-that-works-in-ie/</link>
		<comments>http://bavotasan.com/2009/clearing-the-hr-tag-with-css-that-works-in-ie/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 21:39:09 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[anyone]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Display]]></category>
		<category><![CDATA[Explorer]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[visibility]]></category>
		<category><![CDATA[Width]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=941</guid>
		<description><![CDATA[There is nothing more annoying than Internet Explorer. Every time you build a site you usually need to add a few CSS hacks just to make sure it works in IE. Here is some nice CSS to help anyone who wants to use &#60;hr /&#62; tags to clear sections of their site. hr.clear &#123; background: [...]]]></description>
			<content:encoded><![CDATA[<p>There is nothing more annoying than Internet Explorer. Every time you build a site you usually need to add a few CSS hacks just to make sure it works in IE.</p>
<p>Here is some nice CSS to help anyone who wants to use &lt;hr /&gt; tags to clear sections of their site.<br />
<span id="more-941"></span></p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">hr.<span style="color: #000000; font-weight: bold;">clear</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Just use the following code whenever you want to clear with an  &lt;hr /&gt; tag.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>hr <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;clear&quot;</span> <span style="color: #339933;">/&gt;</span></pre></div></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/clearing-the-hr-tag-with-css-that-works-in-ie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating a Mouseover Fade Effect with jQuery</title>
		<link>http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/</link>
		<comments>http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 15:44:42 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[Creating]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[document]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Grab]]></category>
		<category><![CDATA[head tags]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mouseover]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[possibilities]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=779</guid>
		<description><![CDATA[My last little jQuery tutorial was an alternative to using CSS to create an image change on a mouseover. Now I want to take that one step further and add a fade effect. For my example, I am going to make a black and white image fade into a color image. To achieve this effect [...]]]></description>
			<content:encoded><![CDATA[<p>My last little jQuery tutorial was an alternative to using CSS to create an image change on a mouseover. Now I want to take that one step further and add a fade effect. For my example, I am going to make a black and white image fade into a color image. To achieve this effect I am going to introduce the <a href="http://docs.jquery.com/Effects/animate">animate function</a>. There are tons of possibilities in regards to jQuery&#8217;s animate function, but for this tutorial, I&#8217;m going to keep it simple by just using it to do one thing.<br />
<span id="more-779"></span><br />
First things first, download <a href="http://jquery.com/">jQuery</a>. Grab the Production minified version off of their site. Next, get two images. I used the following.</p>
<p><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota-bw.jpg" alt="cbavota-bw" title="cbavota-bw" width="150" height="122" class="alignleft size-full wp-image-781" /><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota.jpg" alt="cbavota" title="cbavota" width="150" height="122" class="alignleft size-full wp-image-782" /></p>
<hr style="clear:both;border:0;" />
<p>Add the jQuery script between your head tags.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://yoursite.com/jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Here is the function.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;img.a&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span>
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Here is the CSS.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;style<span style="color: #00AA00;">&gt;</span>
&nbsp;
div<span style="color: #6666ff;">.fadehover</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
img<span style="color: #6666ff;">.a</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">10</span><span style="color: #00AA00;">;</span>
        <span style="color: #00AA00;">&#125;</span>
&nbsp;
img<span style="color: #6666ff;">.b</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
&nbsp;
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>And here is the body code.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fadehover&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota-bw.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;a&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;b&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>All together you got something that looks like this.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #0000ff;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #0000ff;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>html xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>jQuery Hover Effect<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #0000ff;">'jquery.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ready<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;img.a&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>hover<span style="color: #009900;">&#40;</span>
<span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
$<span style="color: #009900;">&#40;</span>this<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>stop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>animate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">&quot;opacity&quot;</span><span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;1&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span>
<span style="color: #339933;">&lt;</span>style<span style="color: #339933;">&gt;</span>
div<span style="color: #339933;">.</span>fadehover <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> relative<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
img<span style="color: #339933;">.</span>a <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	left<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	top<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        z<span style="color: #339933;">-</span>index<span style="color: #339933;">:</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
img<span style="color: #339933;">.</span>b <span style="color: #009900;">&#123;</span>
	position<span style="color: #339933;">:</span> absolute<span style="color: #339933;">;</span>
	left<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	top<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>style<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fadehover&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota-bw.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;a&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cbavota.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;b&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Test it out below:</p>
<p><script>
jQuery(document).ready(function(){
	jQuery(".a").hover(
	function() {
		jQuery(this).stop().animate({"opacity": "0"}, "slow");
	},
	function() {
		jQuery(this).stop().animate({"opacity": "1"}, "slow");
	});
});
</script></p>
<div class="fadehover"><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota-bw.jpg" alt="" class="a" /><img src="http://bavotasan.com/wp-content/uploads/2009/08/cbavota.jpg" alt="" class="b" /></div>
<p>NOTE: If you are using jQuery with WordPress, you need to replace all the dollar signs ($) with the word jQuery due to other Javascript libraries that use the dollar sign.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/creating-a-jquery-mouseover-fade-effect/feed/</wfw:commentRss>
		<slash:comments>200</slash:comments>
		</item>
		<item>
		<title>Absolute and Relative Positions in CSS</title>
		<link>http://bavotasan.com/2009/absolute-and-relative-positions-in-css/</link>
		<comments>http://bavotasan.com/2009/absolute-and-relative-positions-in-css/#comments</comments>
		<pubDate>Mon, 25 May 2009 23:51:00 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Amp]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[Containers]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[everyone]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[web programming]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=622</guid>
		<description><![CDATA[In the old days of web programming, everyone use to lay things out with tables. Not so much, anymore. Today, if you are in the know, div tags and CSS positioning is how all the cool kids do it. Here is a quick example of how to layout two columns using div tags and some [...]]]></description>
			<content:encoded><![CDATA[<p>In the old days of web programming, everyone use to lay things out with tables. Not so much, anymore. Today, if you are in the know, div tags and CSS positioning is how all the cool kids do it.<br />
<span id="more-622"></span><br />
Here is a quick example of how to layout two columns using div tags and some CSS.<br />
<img src="http://bavotasan.com/wp-content/uploads/2009/05/picture-2-570x430.png" alt="picture-2" title="picture-2" width="570" height="430" class="aligncenter size-medium wp-image-623" /><br />
First, let&#8217;s create some basic containers.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;wrapper&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;leftcontainer&quot;</span><span style="color: #339933;">&gt;</span>
This is the left container<span style="color: #339933;">.</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;rightcontainer&quot;</span><span style="color: #339933;">&gt;</span>
This is the right container<span style="color: #339933;">.</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Next comes some styles.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.wrapper</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">600px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.leftcontainer</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">380px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">560px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.rightcontainer</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">360px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">560px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Put it all together and this is what you should get.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span><span style="color: #00AA00;">&gt;</span>
&lt;html xmlns<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #00AA00;">&gt;</span>
&lt;head<span style="color: #00AA00;">&gt;</span>
&lt;meta http-equiv<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/html; charset=UTF-8&quot;</span> /<span style="color: #00AA00;">&gt;</span>
&lt;title<span style="color: #00AA00;">&gt;</span>Absolute $amp<span style="color: #00AA00;">;</span> Relative Positions&lt;/title<span style="color: #00AA00;">&gt;</span>
&lt;style<span style="color: #00AA00;">&gt;</span>
div<span style="color: #6666ff;">.wrapper</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">800px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">600px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.leftcontainer</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">380px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">560px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#aaa</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.rightcontainer</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">360px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">560px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;/head<span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;body<span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;div class<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span><span style="color: #00AA00;">&gt;</span>
&lt;div class<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;leftcontainer&quot;</span><span style="color: #00AA00;">&gt;</span>
This is the <span style="color: #000000; font-weight: bold;">left</span> container.
&lt;/div<span style="color: #00AA00;">&gt;</span>
&lt;div class<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;rightcontainer&quot;</span><span style="color: #00AA00;">&gt;</span>
This is the <span style="color: #000000; font-weight: bold;">right</span> container.
&lt;/div<span style="color: #00AA00;">&gt;</span>
&lt;/div<span style="color: #00AA00;">&gt;</span>
&nbsp;
&lt;/body<span style="color: #00AA00;">&gt;</span>
&lt;/html<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>The thing to remember with CSS positions is that you need to identify which div will contain the other. In the example above, <code>div.maincontainer</code> is styled <code>position: relative;</code> because it contains the other two divs. If we didn&#8217;t do this, then when we set <code>div.leftcontainer </code>to <code>position: absolute;</code> it would not position itself within the div container we want.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/absolute-and-relative-positions-in-css/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>A New Comment Editor</title>
		<link>http://bavotasan.com/2009/a-new-comment-editor/</link>
		<comments>http://bavotasan.com/2009/a-new-comment-editor/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 21:46:01 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Colors]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[none]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[Style]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=547</guid>
		<description><![CDATA[I have had some requests to figure out a way that visitors of bavotasan.com could leave code and simple styling in their comments. I searched and searched and tried many different things but none seemed to work that great. I knew I needed a WYSIWYG editor of some sort but the few I came across [...]]]></description>
			<content:encoded><![CDATA[<p><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2009/04/commentpreview.jpg"><img src="http://bavotasan.com/wp-content/uploads/2009/04/commentpreview-200x174.jpg" alt="commentpreview" title="commentpreview" width="200" height="174" class="alignright size-thumbnail wp-image-552" /></a>I have had some requests to figure out a way that visitors of bavotasan.com could leave code and simple styling in their comments. I searched and searched and tried many different things but none seemed to work that great. I knew I needed a WYSIWYG editor of some sort but the few I came across didn&#8217;t really do what I wanted. I was going to try to create one myself but I have been a bit too busy lately to take that on.<br />
<span id="more-547"></span><br />
Luckily I stumbled upon the <a href="http://wmd-editor.com/">WMD editor</a> and the <a href="http://c.hadcoleman.com/wordpress-plugins/wmd-editor-wordpress-plugin/">WordPress plugin created by Chad Coleman</a>. Though, WMD claims not to be a WYSIWYG editor but a WYSIWYM editor, it pretty much does the same thing. </p>
<p>According to the website, WYSIWYM means What You See Is What You Mean. </p>
<p>&#8220;WMD produces clean semantic HTML, leaving presentation details like fonts and colors up to style sheets. But you&#8217;re not left in the dark about cosmetics; as you type, WMD&#8217;s live preview shows you exactly what your text will look like after the current styles have been applied.&#8221;</p>
<p>So far, I like the way it works, and the live preview it great. </p>
<p>NOTE: I no longer use this comment editor plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/a-new-comment-editor/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

