<?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/"
	>

<channel>
	<title>chad carr</title>
	<atom:link href="http://chadcarr.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chadcarr.com</link>
	<description>Thoughts, ideas and tips from Chad Carr - Interactive Designer</description>
	<pubDate>Mon, 30 Nov 2009 20:20:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get rid of comment author website URL in wordpress</title>
		<link>http://chadcarr.com/blog/get-rid-of-comment-author-website-url-in-wordpress/</link>
		<comments>http://chadcarr.com/blog/get-rid-of-comment-author-website-url-in-wordpress/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 20:20:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://chadcarr.com/?p=153</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>The default comment form in Wordpress allows users to submit a website URL in their comment. Most often this is abused as a way to spam links onto your site.</p>
<p>You could simply remove that field from the comment form. But I like to keep it as I can easily spot incoming spam simply by looking at that URL while going over the comments in the site admin. Some people will actually take the time to write some false comment in hopes of getting approved and then sneak in a URL to Viagra or something like that. So keeping the website field helps me pick out those fake comments.</p>
<p>But I don&#8217;t want the URL to show up in the comment, only on the admin side. So to do that you simply edit 1 file in the wp-includes directory.</p>
<p>1. Look for the file called &#8220;comment-template.php&#8221;<br />
2. Locate the bit of code that looks like this: (highlighted in yellow)</p>
<p><img class="alignnone size-full wp-image-154" title="nourlcode1" src="http://chadcarr.com/wp-content/uploads/2009/11/nourlcode1.gif" alt="nourlcode1" width="684" height="338" /></p>
<p>Now change that to look like this: (I recommend simply commenting out the parts that you&#8217;ve removed in case you want to put it back - outlined in red)</p>
<p><img class="alignnone size-full wp-image-155" title="nourlcode2" src="http://chadcarr.com/wp-content/uploads/2009/11/nourlcode2.gif" alt="nourlcode2" width="684" height="338" /></p>
<p>That&#8217;s it. Now when a user adds a website it won&#8217;t show up in the comment, but it will show up in your admin.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/get-rid-of-comment-author-website-url-in-wordpress/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Branding a person</title>
		<link>http://chadcarr.com/blog/branding-a-person/</link>
		<comments>http://chadcarr.com/blog/branding-a-person/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 21:36:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://chadcarr.com/?p=144</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p class="blogExcerptImg"><img class="alignnone size-full wp-image-147" title="tammysml" src="http://chadcarr.com/wp-content/uploads/2009/11/tammysml.gif" alt="tammysml" width="212" height="275" /></p>
<p><img class="mainOnly" title="tammybig" src="http://chadcarr.com/wp-content/uploads/2009/11/tammybig.jpg" alt="tammybig" width="680" height="329" /></p>
<p>Chef Tammy Wong is a local food celebrity here in Minneapolis. Aside from running her restaurant Rainbow, she gives cooking demonstrations, hosts events and is commissioned to prepare private meals for all sorts of well known folk.</p>
<p>Some time ago she came to me looking for signage for her demonstrations. We decided it was time to make an icon, for this icon. And so what you see above it what we came up with. It&#8217;s a good representation of her personality and fun loving spirit.</p>
<p class="alignleft"><img title="tammyblog" src="http://chadcarr.com/wp-content/uploads/2009/11/tammyblog.gif" alt="tammyblog" width="209" height="400" />
<p>You can see it in action on her website. <a href="http://www.rainbowrestaurant.com/tammys-kitchen">Take a look</a> and you&#8217;ll probably stumble upon some great recipes.</p>
<p>If you happen to be in Minneapolis you should visit <a href="http://www.rainbowrestaurant.com">her restaurant, Rainbow</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/branding-a-person/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Plow-Bert</title>
		<link>http://chadcarr.com/blog/plow-bert/</link>
		<comments>http://chadcarr.com/blog/plow-bert/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 20:58:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://chadcarr.com/?p=131</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p class="blogExcerptImg"><img class="alignnone size-full wp-image-132" title="plowbert_sml" src="http://chadcarr.com/wp-content/uploads/2009/11/plowbert_sml.gif" alt="plowbert_sml" width="415" height="171" /></p>
<p><img class="mainOnly" title="plowbertbig" src="http://chadcarr.com/wp-content/uploads/2009/11/plowbertbig.gif" alt="plowbertbig" width="584" height="329" /></p>
<p>Here&#8217;s a new logo/doodle that I developed for a snow plowing company in Minneapolis. Don&#8217;t ask where the name came from. They&#8217;ll be spreading their signs and cards around in the next couple of weeks.</p>
<p>Pictured above are the logo and the business card front/back.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/plow-bert/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Images in auto excerpts - Wordpress, CMSMS</title>
		<link>http://chadcarr.com/blog/images-in-auto-excerpts-wordpress-cmsms/</link>
		<comments>http://chadcarr.com/blog/images-in-auto-excerpts-wordpress-cmsms/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 00:42:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://chadcarr.com/?p=56</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p class="blogExcerptImg"><img class="alignnone size-full wp-image-78" title="example" src="http://chadcarr.com/wp-content/uploads/2009/04/image_excerpts1.jpg" alt="example" width="332" height="181" /></p>
<p>A fellow webling asked me how I got the default excerpts to display images on my site. So after explaining it, I thought maybe someone else out there might be looking to do the same thing. Here&#8217;s how to do it:</p>
<p>Most CMS systems or blogs have an automatic setting to shorten your posts down to a character/word limit in order to show them as an excerpt. These systems usually strip out any html tags within the post. There is actually a good reason for this.</p>
<p>BE CAREFUL<br />
You don&#8217;t want any tag(s) to be orphaned as the excerpt is trimmed down. You will end up with formatting errors in your page(s) if you have an unclosed &lt;div&gt; or &lt;a&gt; tag, or an &lt;img&gt; tag that gets chopped in half. This is because it actually counts the bits of code in the tag as words - taking away from the character/word limit.</p>
<p>But, keeping the above in mind, what if you <em>want</em> an image to show up for each excerpt, as I have on this site? Well, here&#8217;s one way to accomplish this. You will have to do some CSS styling to get the image to look/work the way you want it. We can go over that after we get the image to show up.</p>
<p>There are most likely plug-ins that will get you the same effect, but I found this approach to be the simplest solution.</p>
<h1>Wordpress:</h1>
<p>Find the file on your server here: wp-includes&gt;formatting.php</p>
<p>Then locate this bit of code:</p>
<pre>function wp_trim_excerpt($text) {
	if ( '' == $text ) {
		$text = get_the_content('');

		$text = strip_shortcodes( $text );

		$text = apply_filters('the_content', $text);
		$text = str_replace(']]&gt;', ']]&amp;gt;', $text);
		<span style="background-color:yellow;">$text = strip_tags($text);</span>
		$excerpt_length = apply_filters('excerpt_length', 55);
		$words = explode(' ', $text, $excerpt_length + 1);
		if (count($words) &gt; $excerpt_length) {
			array_pop($words);
			array_push($words, '[...]');
			$text = implode(' ', $words);
		}
	}
	return $text;
}</pre>
<p>The next step tells the function which html tags ARE allowed within the excerpt. We ONLY want to allow the &lt;img&gt; tag.</p>
<p>You allow it to show images by changing it to this:</p>
<pre>function wp_trim_excerpt($text) {
	if ( '' == $text ) {
		$text = get_the_content('');

		$text = strip_shortcodes( $text );

		$text = apply_filters('the_content', $text);
		$text = str_replace(']]&gt;', ']]&amp;gt;', $text);
		<span style="background-color:yellow;">$text = strip_tags($text,'&lt;img&gt;');</span>
		$excerpt_length = apply_filters('excerpt_length', 55);
		$words = explode(' ', $text, $excerpt_length + 1);
		if (count($words) &gt; $excerpt_length) {
			array_pop($words);
			array_push($words, '[...]');
			$text = implode(' ', $words);
		}
	}
	return $text;
}</pre>
<p>That&#8217;s it. If you have an image tag that begins and ends within the first 55 words, it will show up in your excerpt. You can change the number of words by changing the number &#8220;55&#8243; above.</p>
<p>This only works if the image is at the beginning of your post.</p>
<hr />
<h1>CMSMS - CMS Made Simple</h1>
<p>There is a plug in for CMSMS called &#8220;Blogs Made Simple.&#8221; It&#8217;s pretty flexible in its layout and styling. It also has an auto excerpts setting. (My only hang up with this system is its lack of search support.)</p>
<p>Find this file on your server: modules&gt;Blogs&gt;action.showblog.php</p>
<pre> $onerow-&gt;morelink=$this-&gt;CreateLink($id, 'showentry', $returnid, $moretext,
				   array('entryid'=&gt;$dbentry["id"]), '', false, false, '', false, $prettyurl);

    $onerow-&gt;shorttext=<span style="background-color:yellow;">strip_tags($this-&gt;TruncateText($entry["text"],$shortlength)).</span>" ".$onerow-&gt;morelink;
    $onerow-&gt;truncatedtext=<span style="background-color:yellow;">strip_tags($this-&gt;TruncateText($entry["text"],$shortlength));</span>
    $onerow-&gt;text =$entry["text"];
    $time=$entry["createtime"];</pre>
<p>Change it to this:</p>
<pre> $onerow-&gt;morelink=$this-&gt;CreateLink($id, 'showentry', $returnid, $moretext,
				   array('entryid'=&gt;$dbentry["id"]), '', false, false, '', false, $prettyurl);

    $onerow-&gt;shorttext=<span style="background-color:yellow;">strip_tags($this-&gt;TruncateText($entry["text"],$shortlength),'&lt;img&gt;').</span>" ".$onerow-&gt;morelink;
    $onerow-&gt;truncatedtext=<span style="background-color:yellow;">strip_tags($this-&gt;TruncateText($entry["text"],$shortlength),'&lt;img&gt;');</span>
    $onerow-&gt;text =$entry["text"];
    $time=$entry["createtime"];</pre>
<p>That&#8217;s it. You can change the number of words in the module admin area.</p>
<p>This only works if the image is at the beginning of your post.</p>
<hr />
<h2>Now What?</h2>
<p>There are 2 different scenarios I use for this site.</p>
<p>1. I want to use the same image for the post and excerpt. It is most likely larger than the ideal size of the excerpt.</p>
<p><small class="note">If you have a large image that will need to be scaled down to fit within your display of excerpts, you&#8217;ll need some CSS to scale it accordingly.</small></p>
<p>2. I want to have a unique image show up for the excerpt and NOT for the post.</p>
<p>Most systems have a separate template for the main page and single post pages. If you wrap the display of your posts in a &lt;div&gt; with a different id for each, you can style the image differently for each page type. My home page has a &lt;div&gt; with the id of &#8220;mainCol&#8221;. The actual story page has the same &lt;div&gt; with the id of &#8220;mainColLvl2.&#8221; This is enough for me to be able to either scale the image for one or the other, or make it visible or hidden.</p>
<p>I wrap the image in a &lt;p&gt; tag while writing the post. Remember, the &lt;p&gt; tag will be stripped away for the excerpt. If I only want the image to show on the excerpt, I add the class &#8220;blogExcerptImg.&#8221; My CSS says that anything with that class is not displayed on secondary pages.</p>
<p><strong>HTML</strong></p>
<pre>&lt;p class="blogExcerptImg"&gt;
     &lt;img src="pathtoyourimage" /&gt;
&lt;/p&gt;</pre>
<p><strong>CSS</strong></p>
<pre>mainColLvl2 .blogExcerptImg{
     display:none;
}</pre>
<p>I have CSS for the main page that tells the image to be a width of 200px, and a height of &#8220;auto.&#8221; This keeps the image to the width I want, and also scales it proportionally for its height. The html is simplified below to show the ids that wrap it.</p>
<p><strong>HTML</strong></p>
<pre>&lt;div id="mainCol"&gt;
     &lt;div class="entry"&gt;
          &lt;img src="yourimagepath" /&gt;</pre>
<p><strong>CSS </strong><br />
This gives the image its border, scales it to 200px, aligns it to the left of my text, etc.</p>
<pre>#mainCol .entry img {
	border:1px solid #333333;
	display:inline !important;
	float:left;
	height:auto;
	margin-right:10px;
	padding:1px;
	width:200px;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/images-in-auto-excerpts-wordpress-cmsms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Textures in Media Gallery</title>
		<link>http://chadcarr.com/blog/new-textures-in-media-gallery/</link>
		<comments>http://chadcarr.com/blog/new-textures-in-media-gallery/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 06:08:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://chadcarr.com/wordpress/?p=26</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.chadcarr.com/media/main.php?g2_view=core.ShowItem&amp;g2_itemId=435" target="_parent"><img title="sample texture" src="http://www.chadcarr.com/media/d/459-3/IMG_1098.jpg" alt="sample texture" width="680" height="454" /></a></p>
<p>India is full of amazing colors and textures. Almost every surface you see offers its own canvas. I constantly cursed myself when I would venture out without the camera. But I managed to collect a few good samples. I have put a them up in my media gallery for you to enjoy.</p>
<p>It&#8217;s a useful design techniques to <a href="http://www.bittbox.com/photoshop/how-to-make-a-photoshop-brush/" target="_blank">make Photoshop brushes from textures</a> like these to create interesting effects in your work.</p>
<p>Feel free to use them for any non-commercial purpose.</p>
<p><a href="http://www.chadcarr.com/media/main.php?g2_view=core.ShowItem&amp;g2_itemId=435">Click here to go to the Media Gallery.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/new-textures-in-media-gallery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>India Trip - 2009</title>
		<link>http://chadcarr.com/blog/india-trip-2009/</link>
		<comments>http://chadcarr.com/blog/india-trip-2009/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 22:10:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://chadcarr.com/wordpress/?p=30</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img title="streets of Varanasi" src="http://www.chadcarr.com/media/main.php?g2_view=core.DownloadItem&amp;g2_itemId=235&amp;g2_serialNumber=1" alt="streets of Varanasi" width="583" height="389" /></p>
<p>We recently took a work/tourism trip to India. And although I could ramble on and on about it, let me simply say that it was very cool. The only way to describe the experience is to have been there. But, we took a lot of photos, in fact too many. <a href="http://www.chadcarr.com/media/main.php?g2_view=core.ShowItem&amp;g2_itemId=195">You can take a look at an assortment from our time with some friends here. </a></p>
<p>I&#8217;ve been there before and will most likely go back many times if I can. I&#8217;m not a spaced out hippie or anything, so I won&#8217;t tell you that I &#8220;found&#8221; myself, had some kind of yoga experience or any other cliche &#8220;westerner goes east&#8221; type spiritual enlightenment. But I did learn a lot about the people, culture and places. And I enjoyed all 3.</p>
<p><a href="http://www.c-moto.com" target="_blank">C-moto</a> is designing and developing an eco-tourism site for the <a href="http://en.wikipedia.org/wiki/Varanasi" target="_blank">city of Varanasi</a>. We went on tours, took photos and talked to locals along the way. The tours help provide context to the city for tourists as they maneuver through the alleys, along paths full of temples, bizzars and cultural diversity. There&#8217;s nothing like having a guide that really knows the ins and outs of a place.</p>
<p>We&#8217;re hoping to have the site up in the next couple of months.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/india-trip-2009/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Things With Wings</title>
		<link>http://chadcarr.com/blog/things-with-wings/</link>
		<comments>http://chadcarr.com/blog/things-with-wings/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 22:09:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Illustration]]></category>

		<guid isPermaLink="false">http://chadcarr.com/wordpress/?p=28</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img title="Things with wings" src="http://www.chadcarr.com/media/main.php?g2_view=core.DownloadItem&amp;g2_itemId=483&amp;g2_serialNumber=2" alt="Things with wings" width="660" height="508" /></p>
<p>Here are some works I created a couple of years ago. Ink, powder and pencil on canvas. Each one named &#8220;Things with Wings++&#8221; (coders might get that ++ bit).</p>
<p><a href="http://www.chadcarr.com/media/main.php?g2_view=core.ShowItem&amp;g2_itemId=489">You can view them in the Media Gallery here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/things-with-wings/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IE 6 and my 1962 Lambretta</title>
		<link>http://chadcarr.com/blog/ie-6-and-my-1962-lambretta/</link>
		<comments>http://chadcarr.com/blog/ie-6-and-my-1962-lambretta/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 21:44:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://chadcarr.com/wordpress/?p=24</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-40" title="scootvsie" src="http://chadcarr.com/wp-content/uploads/2009/04/scootvsie.jpg" alt="scootvsie" width="500" height="374" /></p>
<p>How many years ago did IE 6 come out now? Oh, I don&#8217;t even know. Web years are like dog years. So let&#8217;s say 56 years ago. That&#8217;s what is seems like. So no wonder it feels strange to continue to code for IE 6 - 56 years after it came out.</p>
<p>I don&#8217;t ask my local motorcycle shop why they aren&#8217;t compatible with my 1962 Lambretta. Oh I could try to tell them that my Lambretta is more secure or that it just &#8220;works for me&#8221;. But they won&#8217;t care. They&#8217;ll laugh and look on nostalgically as I putter out of site. Leaving huge puffs of white smoke that signal my hip exhibition of love for the retro life. O.K. I admit that an old scooter is much more useful than an old browser, but you get my point.</p>
<p>So fear not ye old time web scooters, er, well&#8230; more like Larks. I shall still support your ancient religion of IE 6. It might no look exactly the same. But how will you even know? That would mean that you are viewing the site on 2 different browsers, one old and unwise to the ways of the modern CSS, and one new and capable of these aesthetic formations. Why would you do that? Use a modern browser and an old one? Well, you wouldn&#8217;t. Neither would most anyone else, save for those of us that toil in this trade.</p>
<p>Here&#8217;s what we can do:</p>
<p>Serve you a unique set of CSS that will make the site look acceptable. It won&#8217;t have all the good looks of the modern browsers, but you won&#8217;t know. How could you?</p>
<p>And it will look like this:</p>
<pre id="line21">&lt;!--[if lt IE 7]&gt;

&lt;link href="style/ie6isGreat.css" rel="stylesheet" type="text/css" /&gt;

&lt;![endif]--&gt;
</span></pre>
<p>Then we&#8217;ll hide all the PNG files and unsupported CSS from you and replace them with GIFs or something. Yes we could use some javascript to force you to see those PNGs. But, like I said, I&#8217;m not sure it&#8217;s worth it.</p>
<p>So please understand, if your vehicle is 56 years old, the road might not look the same but I&#8217;ll make sure that it will eventually get you to the same place.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/ie-6-and-my-1962-lambretta/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simple overlay Image captions - CSS</title>
		<link>http://chadcarr.com/blog/simple-overlay-image-captions-css/</link>
		<comments>http://chadcarr.com/blog/simple-overlay-image-captions-css/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 21:06:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://chadcarr.com/wordpress/?p=12</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-14" title="Simple CSS captions overlay" src="http://chadcarr.com/wp-content/uploads/2009/04/captions_img.jpg" alt="Simple CSS captions overlay" width="377" height="251" /></p>
<p>Here&#8217;s a CSS only way to add an overlay caption on top of an image. There are of course javascript alternatives that require less HTML markup. These use the &#8220;title&#8221; tag as the caption. This post is simply an alternative for those who don&#8217;t want to mess around with javascript.</p>
<p>The transparency may not work in IE 6.</p>
<p>First the structure:</p>
<pre>&lt;div class="ImgCaptMain"&gt;
     &lt;img border="0" alt="Some Image" src="images/current_chadcarr.jpg"/&gt;&lt;br /&gt;
     &lt;div class="ImgCaptDescBox"&gt;
         &lt;div class="ImgCaptDescBg"&gt;
               &lt;div class="ImgCaptDesc"&gt;
           	New York - Late 2008.
               &lt;/div&gt;
         &lt;/div&gt;
    &lt;/div&gt;&lt;/div&gt;</pre>
<p>Create a tree of 4 &lt;div&gt; tags. (&lt;div&gt; inside of a &lt;div&gt; inside of a &lt;div&gt; inside of a &lt;div&gt;)</p>
<ol>
<li>The first &lt;div&gt; doesn&#8217;t really have to do much other than give itself a position of relative.</li>
<li>Then you place your &lt;img&gt; tag.</li>
<li>The second &lt;div&gt; tag will contain the caption description and the transparent background</li>
</ol>
<p>Here is the CSS:</p>
<pre>.ImgCaptMain{
	/* only need a width if it's not inheriting one
 	width:; */
	position:relative;
}

.ImgCaptDescBox{
	position:absolute;
	bottom:0;
	left:0;
	/* since it's positioned absolutely it will need a width, but not height,
       that would fill the entire box covering the image */
	width:100%;
}

.ImgCaptDescBg{
	background:#333333;
	filter:alpha(opacity=50);
	-moz-opacity:0.5;
	-khtml-opacity: 0.5;
	opacity: 0.5;
}

.ImgCaptDesc{
	padding:5px;
	color:#fff;
	font-weight:normal;
	font-size:.785em;
	text-align:left;
}</pre>
<p>The code above set&#8217;s the caption at the bottom as in figures A and B above. If you want the caption at the top of your image as in figures C and D, just change 1 simple piece of CSS. In the ImgCaptDescBox class, change <span style="font-family: courier new,courier;">bottom:0;</span> to <span style="font-family: courier new,courier;">top:0;</span> like below:</p>
<pre>.ImgCaptDescBox{
	position:absolute;
	<span style="background-color: yellow; text-decoration: line-through;">bottom:0;</span>
	<span style="background-color: yellow;">top:0;</span>
	left:0;
	width:100%;
}</pre>
<p>That&#8217;s it.</p>
<p>Here&#8217;s a working example:</p>
<div class="ImgCaptMain" style="width: 204px;"><img class="size-full wp-image-21" title="current_chadcarr" src="http://chadcarr.com/images/current_chadcarr.jpg" alt="sample css caption overlay" width="200" height="229" /></p>
<div class="ImgCaptDescBox">
<div class="ImgCaptDescBg">
<div class="ImgCaptDesc">New York - Late 2008.</div>
</div>
</div>
</div>
<p>You could also add the &#8220;float:&#8221; property to the &#8220;ImgCaptMain&#8221; &lt;div&gt; if you want to align the image with text or other elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://chadcarr.com/blog/simple-overlay-image-captions-css/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
