<?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>Websites for Small Biz &#187; CSS</title>
	<atom:link href="http://biz.leoraw.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://biz.leoraw.com</link>
	<description>WordPress, Social Media, Twitter Talk, Business, SEO</description>
	<lastBuildDate>Tue, 07 Feb 2012 12:46:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Related Posts &#8211; CSS Method</title>
		<link>http://biz.leoraw.com/related-posts-css/</link>
		<comments>http://biz.leoraw.com/related-posts-css/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 14:32:40 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=3820</guid>
		<description><![CDATA[Related Posts can be created with a plugin or with PHP code.  You can also use HTML and CSS code to create unique related posts. In this article, learn the HTML and CSS code to create Related Posts.]]></description>
			<content:encoded><![CDATA[<div style="padding: 10px; background-color: #eee;border: 1px solid #ccc; margin-right: auto; margin-left: auto; text-align:center;"><img src="http://biz.leoraw.com/wp-content/uploads/2012/01/related-posts.jpg" alt="Related Posts - How to Set Up Using CSS" title="related-posts" width="550" height="230" class="alignnone size-full wp-image-3848" style="border: 1px solid #ccc;" /></div>
<h3 class="present">What are Related Posts</h3>
<p>When someone visits your blog post, you can display some related posts at the bottom to entice your visitor to view other posts on your site as well. So, for example, let&#8217;s say you are posting about a new WordPress plugin. You might want to display some other posts you wrote about WordPress plugins, or you might want to display a post about content management systems, or maybe one about why WordPress is so popular.</p>
<h3 class="present">Are There Easy Ways to Display Related Posts?</h3>
<p>You want an easy way to do this?  There are some nice plugins to display Related Posts, here are two:</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/">Yet Another Related Posts Plugin (YARPP)</a></li>
<li><a href="http://wordpress.org/extend/plugins/efficient-related-posts/">Efficient Related Posts</a> (thanks to Barry Wells for the recommendation)</li>
</ul>
<p>If you have self-hosted WordPress, you can install a plugin easily on your blog.  And you don&#8217;t really have to read the rest of this post.  But if you install a related posts plugin and you don&#8217;t like the way it appears or which posts it chooses as related posts, maybe you want to keep reading this post.</p>
<p>If you like a coding way to display related posts, without a plugin, try one of these articles:</p>
<ul>
<li><a href="http://alexwhinfield.com/display-related-posts-using-php-instead-of-a-plugin/">Display Related Posts using PHP instead of a Plugin</a></li>
<li><a href="http://www.wprecipes.com/how-to-show-related-posts-without-a-plugin">How to: Show related posts without a plugin</a>
</li>
</ul>
<p>You will find, however, that those coded posts are based on tags.  What if you want to display a post that doesn&#8217;t have the same tag?  Or you want the 6th post in the second tag on your post to display?</p>
<p style="text-align:center; color: #666;font-size: 24px;">&bull;&nbsp;&bull;&nbsp;&bull;</p>
<p>What? You are still here?  Oh, yes, now I am going to teach the slow and meticulous way to set up related posts, so you can tweak every little detail.  And you can learn some CSS (Cascading Style Sheets &#8211; it&#8217;s the best way to make your website shine with design) in the process.  Once you set this up for one post, you will find it quite easy to re-use the code with new links on another post.</p>
<h3 class="present">Thinking Through Our Layout Needs for the Related Posts</h3>
<div style="float:right; width: 200px; margin-left: 10px; margin-top: 10px;"><img src="http://biz.leoraw.com/wp-content/uploads/2012/01/related-posts-200px.jpg" alt="related posts" title="related-posts-200px" width="200" height="200" class="alignnone size-full wp-image-3889" /></div>
<p>To set up our related posts, we are going to need:</p>
<ul>
<li><strong>Thumbnail images for each post</strong> &#8211; if you have these already, great.  But if not, you will need to create some thumbnails.  I am going to make mine 100px by 100px, but they don&#8217;t have to be that size.</li>
<li><strong>Links to the Posts</strong> &#8211; I find it handy to set up my code in a code editor separate from WordPress (I used Dreamweaver).  For now, just paste into your code editor 3-4 links that you would like to appear in your related posts.</li>
</ul>
<p>We want these thumbnail images to line up nicely on the bottom of a post, each with a little caption underneath.  Both the thumbnails and the captions should be linked to the related post.  One&#8217;s first reaction might be to put this in a table, but a nicer way to code that will help if you are also doing responsive design (you want this to appear on mobile neatly, too) would be to float each little area of the related links. (If you don&#8217;t know about floats, <a href="http://biz.leoraw.com/float-that-image/">read about floats</a>).</p>
<h3 class="present">Set up the HTML and CSS</h3>
<p>Here&#8217;s how the HTML should look for three links (add another related-area div for four links):</p>
<pre>
<div class="codecolorer-container html4strict default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/hr.html"><span style="color: #000000; font-weight: bold;">hr</span></a> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span>Related Posts:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-links clearfix&quot;</span>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--start related links area--&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-area&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-img&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/clear-float/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/wp-content/uploads/2009/12/water_effect2-100x100.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;unwanted wrap around text - needs to clear float&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-tag&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/clear-float/&quot;</span>&gt;</span>Unwanted Wrap<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-area&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-img&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/css-spacing-woes-and-solutions/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/wp-content/uploads/2010/10/spacing_woes-sq.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;CSS spacing woes&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-tag&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/css-spacing-woes-and-solutions/&quot;</span>&gt;</span>CSS Spacing<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-area&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-img&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/fancy-colored-boxes-with-css/&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/wp-content/uploads/2009/12/fancy-boxes-css.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Fancy Colored Boxes with CSS&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;related-tag&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://biz.leoraw.com/fancy-colored-boxes-with-css/&quot;</span>&gt;</span>Fancy Boxes<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">a</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><span style="color: #808080; font-style: italic;">&lt;!--end related links area--&gt;</span><br />
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/hr.html"><span style="color: #000000; font-weight: bold;">hr</span></a> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
</pre>
<p>And here&#8217;s the CSS:</p>
<pre>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">/*RELATED POSTS<br />
========================================*/</span><br />
<span style="color: #6666ff;">.related-area</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.related-links</span> <span style="color: #6666ff;">.related-area</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">135px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">30px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.related-img</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#eee</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;">#999999</span><span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.related-img</span> img <span style="color: #00AA00;">&#123;</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;">#999999</span><span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #6666ff;">.clearfix</span><span style="color: #3333ff;">:after </span><span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp;<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><br />
&nbsp; &nbsp;<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><br />
&nbsp; &nbsp;<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><br />
&nbsp; &nbsp;<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><br />
<span style="color: #00AA00;">&#125;</span></div></div>
</pre>
<p>I would suggest doing all this in your code editor, check it offline, and then copy to your WordPress post.  You should save the HTML code somewhere convenient so you can use it again for a later post, just add different related links.  </p>
<p>You should copy the CSS to the bottom of your theme&#8217;s style.css.  Be sure to put a comment on top of the CSS that says /*Related Posts*/ so you know what this section of your style.css does.</p>
<p>Hope some of you find this Related Posts with CSS useful!  If it&#8217;s too much code for you, go to the top of this post and try the YARRP plugin.</p>
<hr />
<strong>Related Posts:</strong></p>
<div class="related-links clearfix"><!--start related links area--></p>
<div class="related-area">
<div class="related-img"><a href="http://biz.leoraw.com/clear-float/"><img src="http://biz.leoraw.com/wp-content/uploads/2009/12/water_effect2-100x100.jpg" alt="unwanted wrap around text - needs to clear float" /></a></div>
<div class="related-tag"><a href="http://biz.leoraw.com/clear-float/">Unwanted Wrap</a></div>
</div>
<div class="related-area">
<div class="related-img"><a href="http://biz.leoraw.com/css-spacing-woes-and-solutions/"><img src="http://biz.leoraw.com/wp-content/uploads/2010/10/spacing_woes-sq.jpg" alt="CSS spacing woes" /></a></div>
<div class="related-tag"><a href="http://biz.leoraw.com/css-spacing-woes-and-solutions/">CSS Spacing</a></div>
</div>
<div class="related-area">
<div class="related-img"><a href="http://biz.leoraw.com/fancy-colored-boxes-with-css/"><img src="http://biz.leoraw.com/wp-content/uploads/2009/12/fancy-boxes-css.jpg" alt="Fancy Colored Boxes with CSS" /></a></div>
<div class="related-tag"><a href="http://biz.leoraw.com/fancy-colored-boxes-with-css/">Fancy Boxes</a></div>
</div>
</div>
<p><!--end related links area--></p>
<hr />
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=3820&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/related-posts-css/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>So You Want to Widen Your Sidebar</title>
		<link>http://biz.leoraw.com/widen-your-sidebar/</link>
		<comments>http://biz.leoraw.com/widen-your-sidebar/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 00:17:44 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[container]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[novice]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=3417</guid>
		<description><![CDATA[Know how the layout of your WordPress site is constructed: it probably has a wrapper or container, content and sidebar.  Content + sidebar = container size. If sidebar is too big, it will float down.]]></description>
			<content:encoded><![CDATA[<div style="float:right; width: 100px; margin-left: 10px;"><img src="http://biz.leoraw.com/wp-content/uploads/2011/11/layout-css-sq.gif" alt="layout css" title="layout-css-sq" width="100" height="109" class="alignnone size-full wp-image-3439" /></div>
<p>A friend decided to widen her sidebar on her self-hosted WordPress site last week.  Oops, the sidebar floated down under the main content.  What to do?</p>
<p>This is a basic post on how the layout of your WordPress site is constructed.  Even if you never touch the code yourself, you may want to understand what needs to be done when you ask your web designer/developer to widen the sidebar on your site.  Not all CSS layouts are constructed in this manner, but many have these three basic elements:</p>
<ol>
<li><strong>Wrapper</strong> or <strong>container</strong></li>
<li><strong>Content</strong></li>
<li><strong>Sidebar</strong></li>
</ol>
<p>In some layouts, the wrapper may be one big div that is about 850px to 1000px wide.  In other layouts, especially responsive layouts like <a href="http://lessframework.com/">lessframework.css</a>, a class called <strong>container</strong> takes over from what the wrapper used to do, and then the header, main area and footer are all given the class of container to keep them the same width.  The content and sidebar are added together to make the size of the container or wrapper; for example, if the sidebar is 300px inside a container of 900px, the content is 600px.  The numbers you see in your CSS may be smaller due to padding on either side of the content or sidebar.</p>
<p>Here is a chart that illustrates how this might look with a wrapper of 900px:<br />
<img src="http://biz.leoraw.com/wp-content/uploads/2011/11/layout-css.gif" alt="layout for css - sidebar, header, content, footer, wrapper, container" title="layout-css" width="478" height="565" class="alignnone size-full wp-image-3430" /></p>
<p>So what happens if you make your sidebar 320px?  It will float down under the content, because it can no longer fit inside the wrapper.  If you want make your sidebar larger, you either need to make your content smaller or make your wrapper/container larger.  Here I did a similar illustration with a larger wrapper:<br />
<img src="http://biz.leoraw.com/wp-content/uploads/2011/11/layout-css-wider.gif" alt="wider layout for css - sidebar, header, content, footer, wrapper, container" title="layout-css-wider" width="499" height="555" class="alignnone size-full wp-image-3435" /><br />
Some pointers on fixing a layout:</p>
<ol>
<li>Take out all padding and margins on sidebar and content and see if that helps. Make sure the sidebar + content adds up to the wrapper (or less).</li>
<li>Use background-colors on the sidebar and content temporarily to see where the code is being applied.  For example, make the sidebar yellow and the content green.  This often helps in figuring out the layout problems.  Don&#8217;t forget to the take the weird colors out on the production (real) site.</li>
</ol>
<p>Want to learn more CSS?</p>
<ul>
<li><a href="http://css-tricks.com/795-all-about-floats/">All About Floats</a></li>
<li><a href="http://www.456bereastreet.com/lab/developing_with_web_standards/csslayout/2-col/">Simple 2 column CSS layout</a></li>
<li><a href="http://wordpress.org/support/topic/sidebar-pushed-down-1">Sidebar pushed down</a> (in the WordPress codex, someone had a similar problem with the sidebar floating down under the content &#8211; read the pointers by hellomatt)</li>
<li><a href="http://biz.leoraw.com/2010/10/float-that-image/">Float that Image</a></li>
</ul>
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=3417&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/widen-your-sidebar/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why is My Text Wrapping Around My Image?</title>
		<link>http://biz.leoraw.com/clear-float/</link>
		<comments>http://biz.leoraw.com/clear-float/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 15:09:01 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[novice]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=2251</guid>
		<description><![CDATA[When you switch from one template to another, your text may appear in unwanted places. It will look normal if you clear the float before the text shows up in the code.]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you switch from one template to another (this has happened in both WordPress and in Joomla), your text may appear in unwanted places.  Like this:</p>
<p><img src="http://biz.leoraw.com/wp-content/uploads/2009/12/water_effect2.jpg" alt="watercolor effect" title="water_effect2" width="520" height="367" class="size-full wp-image-860" style="float:left;" /><br />
This is some text that will appear to the far right if coded with float: left; in the img tag.  But it will look normal if you clear the float before the text shows up in the code.  How does it look now?</p>
<p>See how the text is squished over the right of the image?  Strangely enough, in a previous template the text landed below the image, as the author planned it should go.  Here&#8217;s how one wants the image and text to appear:<br />
<img src="http://biz.leoraw.com/wp-content/uploads/2009/12/water_effect2.jpg" alt="watercolor effect" title="water_effect2" width="520" height="367" class="size-full wp-image-860"  /><br />
This is some text that will appear to the far right if coded with float: left; in the img tag.  But it will look normal if you clear the float before the text shows up in the code.  How does it look now? </p>
<p>So what is happening here?  The answer is the default in the new template for images is to <strong>float the image</strong>  to the left(float:left;).  You have a few choices: you can either go into the CSS and take out the line about the image floating to the left (but you do have to locate the line to do so), you can add a class to your CSS to clear certain images OR you can clear the float using inline code.  I am going to teach you how to add the inline code to your WordPress post.  You need to be working in HTML mode (as opposed to Visual mode).</p>
<p><strong>Here&#8217;s how to clear a float:</strong><br />
When you start the paragraph for the text directly below the image, add the following code:</p>
<p style="padding:5px; border:1px solid #ccc; background-color: #eee">&lt;div style=&#8221;clear:left&#8221;&gt;text here&lt;/div&gt;</p>
<p>The order of the code should be img tag, then a div tag with style=&#8221;clear: left&#8221;.  You can use a paragraph &lt;p style=&#8221;clear:left;&#8221;&gt; tag instead of the &lt;div style=&#8221;clear:left;&#8221;&gt; if you like.</p>
<p>Any questions?</p>
<div style="float:right; width: 100px;"><a href="http://biz.leoraw.com/2009/12/photoshop-favorites-of-2009/"><img src="http://biz.leoraw.com/wp-content/uploads/2009/12/water_effect2-100x100.jpg" alt="Watercolor effect on a photo of girl in a stream" title="Watercolor effect on a photo of girl in a stream 100x100" width="100" height="100" class="alignright size-full wp-image-886" /></a></div>
<p>More on floats and CSS:</p>
<ul>
<li><a href="http://biz.leoraw.com/2010/10/float-that-image/">Float that Image</a></li>
<li><a href="http://biz.leoraw.com/2010/04/links-to-tutorials-on-html-and-css/">Links to tutorials on HTML and CSS</a></li>
</ul>
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=2251&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/clear-float/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS: Spacing Woes and Solutions</title>
		<link>http://biz.leoraw.com/css-spacing-woes-and-solutions/</link>
		<comments>http://biz.leoraw.com/css-spacing-woes-and-solutions/#comments</comments>
		<pubDate>Tue, 26 Oct 2010 18:13:34 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[novice]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=2036</guid>
		<description><![CDATA[You want to get rid of the space on your web page. Learn this simple trick to solve frustrating CSS spacing problems.]]></description>
			<content:encoded><![CDATA[<div style="float:right; width: 180px;"><img src="http://biz.leoraw.com/wp-content/uploads/2010/10/spacing_woes1.jpg" alt="spacing woes" title="spacing_woes" width="180" height="160" class="alignright size-full wp-image-2077" /></div>
<p>Have you ever had text that looks like this:</p>
<div style="margin-left: 20px; background-color: #eeeeee; margin-right:200px; padding: 3px; padding-left: 10px;">
<p><strong>Top text</strong> runs here and <strong>should</strong> be directly on top:</p>
<p>Bottom text here</p>
</div>
<p>You want to get rid of the space between the top and the bottom.  How do you accomplish this? </p>
<p>To an accomplished webmaster this is a simple question.  To those just learning CSS, this can be a royal pain.  So what could be causing that spacing?</p>
<ol>
<li style="margin-bottom: 10px;"><span style="font-size:larger;"><strong>&lt;p&gt; tags instead of &lt;div&gt; tags</span></strong><br />
Simply switch to &lt;div&gt; tags in your HTML, and the spacing goes away.  &lt;p&gt; tags have margins built-in, while &lt;div&gt; tags do not.  Unless, of course, you or someone else changed the CSS for the &lt;div&gt; tags.  See the next idea below.
</li>
<li  style="margin-bottom: 10px;"><span style="font-size:larger;"><strong>CSS is set with margins or padding</strong></span><br />
Check your style sheet to see if <strong>div</strong> has any margin or padding added.  You can change this, or you can make a class below the original declaration that changes only some cases, cases that have that particular class added.  So your CSS might look like this:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
.myspacing {<br />
<span style="padding-left: 30px;">margin-bottom: 0; </span><br />
<span style="padding-left: 30px;">margin-top: 0; </span><br />
<span style="padding-left: 30px;">padding-bottom: 0; </span><br />
<span style="padding-left: 30px;">padding-top: 0; </span><br />
}</div>
<p>and your html where you want all spacing eliminated like this:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
&lt;div class=&#8221;myspacing&#8221; &gt; some text here &lt;/div&gt;</div>
<p>If you are using header tags (h1, h2, h3, etc.), know that they, like paragraph tags, by default add spacing to top and bottom.  You can either change the default in the CSS to eliminate the spacing or you can add the &#8220;myspacing&#8221; class to only the header tags that you choose.
</li>
<li  style="margin-bottom: 10px;"><span style="font-size:larger;"><strong>Are you using an image?  Is the image causing extra spacing?</strong></span></li>
<p>Last week I was working on a client&#8217;s site and was wondering why I wasn&#8217;t able to get rid of the spacing between the top and the bottom.  It turned out the image I was using as a bullet was adding extra space.  I switched to a <strong>&amp;bull</strong>; bullet (a special character HTML bullet: &bull;), and then my spacing issues were eliminated.  Want to know how I quickly figured this out?  See the tip below.
</ol>
<p>Whenever you are unsure of where space is being added in a section of a web page, <strong>add bright, weird background-colors</strong> to the sections involved in the spacing issue.  Here&#8217;s my example:</p>
<p>This is how it looked before I added the weird colors:</p>
<div style="padding: 10px; border: 1px solid #cccccc; margin-right: 50px;">
<div style="margin:left:50px; font-size:larger;">To Learn More About Chocolate Frogs and WordPress:</div>
<div style="margin:left:50px; "><img src="http://biz.leoraw.com/wp-content/uploads/2010/10/arrow.gif" alt=" " title="arrow" width="8" height="23" class="alignnone size-full wp-image-2061" />&nbsp;<a href="http://biz.leoraw.com/2010/02/why-use-wordpress-for-your-small-biz-website/">Read this Blog Every Day! And share your chocolate frogs.</a></div>
</div>
<p>You can&#8217;t tell whether the extra spacing is from the bottom or from the top, right?<br />
With the weird colors showing the two sections:</p>
<div style="padding: 10px; border: 1px solid #cccccc; margin-right: 50px;">
<div style="margin:left:50px; font-size:larger; background-color: #ff8e4e;">To Learn More About Chocolate Frogs and WordPress:</div>
<div style="margin:left:50px; background-color: #cc99e5; "><img src="http://biz.leoraw.com/wp-content/uploads/2010/10/arrow.gif" alt=" " title="arrow" width="8" height="23" class="alignnone size-full wp-image-2061" />&nbsp;<a href="http://biz.leoraw.com/2010/02/why-use-wordpress-for-your-small-biz-website/">Read this Blog Every Day! And share your chocolate frogs.</a></div>
</div>
<p>Now it should be obvious that the bottom is causing the extra spacing.  I eliminate the triangle image to see what happens:</p>
<div style="padding: 10px; border: 1px solid #cccccc; margin-right: 50px;">
<div style="margin:left:50px; font-size:larger; background-color: #ff8e4e;">To Learn More About Chocolate Frogs and WordPress:</div>
<div style="margin:left:50px; background-color: #cc99e5; ">&nbsp;<a href="http://biz.leoraw.com/2010/02/why-use-wordpress-for-your-small-biz-website/">Read this Blog Every Day! And share your chocolate frogs.</a></div>
</div>
<p>The spacing issue is now gone.  I could get an image that doesn&#8217;t cause spacing conflicts, but in the interest of time, I add a &bull; in color, and here&#8217;s my final result:</p>
<div style="padding: 10px; border: 1px solid #cccccc; margin-right: 50px;">
<div style="margin:left:50px; font-size:larger; ">To Learn More About Chocolate Frogs and WordPress:</div>
<div style="margin:left:50px;  "><span style="color: #cc0033;">&bull;</span>&nbsp;<a href="http://biz.leoraw.com/2010/02/why-use-wordpress-for-your-small-biz-website/">Read this Blog Every Day! And share your chocolate frogs.</a></div>
</div>
<p>Another common spacing headache for CSS beginners is tables, but that&#8217;s a topic for a whole different post.  </p>
<p>For more posts on CSS:</p>
<ul>
<li><a href="http://biz.leoraw.com/2009/12/fancy-colored-boxes-with-css/">Fancy Colored Boxes with CSS</a></li>
<li><a href="http://biz.leoraw.com/2010/10/float-that-image/">Float That Image</a></li>
</ul>
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=2036&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/css-spacing-woes-and-solutions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Float That Image</title>
		<link>http://biz.leoraw.com/float-that-image/</link>
		<comments>http://biz.leoraw.com/float-that-image/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 03:33:05 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[novice]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=1974</guid>
		<description><![CDATA[Learn how to float an image next to text, how to add margins to the floated image and to add captions under the image.]]></description>
			<content:encoded><![CDATA[<div style="float:right; width: 150px; margin-left: 10px; margin-top: 10px;"><img src="http://biz.leoraw.com/wp-content/uploads/2010/10/marigold_150px.jpg" alt="marigold against pink begonia" title="marigold_150px" width="150" height="107" class="alignnone size-full wp-image-1985" />
<div style="font-size: smaller">This image is floated to the right and has a left margin of 10px.  In this post you will learn how to float an image.</div>
</div>
<p>A common question I get is:  How to I put such-and-such image next to my big text? Or, how do I get space between my image and the paragraph of text? Or, how can I put an image next to a paragraph of text and include a caption with a link under the image?</p>
<p>All of these questions are related to <strong>floating the image</strong>.  Let&#8217;s say you have a big line of text at the top of your web page that says:</p>
<div style="text-align: center">MY COMPANY AND PROUD OF IT</div>
<p>You want to put a logo next to that text.  I am going to show you how to FLOAT the image.  This is how it will look when the logo is floated to the left:</p>
<hr />
<div style="float:left; width: 150px; margin-right: 40px;">
<img src="http://biz.leoraw.com/wp-content/uploads/2010/10/logo_fawcett.png" alt="fawcett &amp; hawkes logo" title="logo_fawcett" width="120" height="114" class="size-full wp-image-1990" /></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<p>MY COMPANY AND PROUD OF IT</p>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div style="clear: left;">
<hr />
Here&#8217;s what you do:<br />
1) First, find out how wide the image is.  If you right-click on the image in your browser, you can find out the width of the image by looking at the properties.  </div>
<p>2) You will then define a CSS rule.  The rule will help create an area that is floated to the left and given exactly the width of the image:</p>
<p>.myfloat {float: left; width: 150px}</p>
<p>3) You wrap the image inside a div tag and give it a class of myfloat:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
<p>&lt;div class=&#8221;myfloat&#8221;&gt;&lt;img src=&#8221;imageofmine.jpg&#8221; alt=&#8221;some image&#8221;&gt;&lt;/div&gt;&lt;div&gt;MY COMPANY AND PROUD OF IT&lt;/div&gt;
</p></div>
<p>You can put the CSS code in your style sheet; this is called <strong>style.css</strong> if you are using WordPress.  Or you can put it directly into a WordPress post by using inline CSS code:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
<p>&lt;div style=&#8221;width: 150px; float:left;&#8221;&gt;&lt;img src=&#8221;imageofmine.jpg&#8221; alt=&#8221;some image&#8221;&gt;&lt;/div&gt;&lt;div &gt;MY COMPANY AND PROUD OF IT&lt;/div&gt;
</p></div>
<p>If you think it&#8217;s code that you will use repeatedly, you should really put it in your style sheet.</p>
<p>So now you have learned how to float an image to the left (to float it to the right, use float: right), but what about margins and captions?  If it&#8217;s in a div tag (as opposed to relying on align=&#8221;right&#8221; or align=&#8221;left&#8221; inside the image tag), you can easily add a caption inside the div tag.  Margins can be added by adding margin rules to the CSS:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
<p>&lt;div style=&#8221;width: 150px; float:left; margin-right: 30px;&#8221;&gt;&lt;img src=&#8221;imageofmine.jpg&#8221; alt=&#8221;some image&#8221;&gt;&lt;div&gt; My caption here&lt;/div&gt;&lt;/div&gt;&lt;div&gt;MY COMPANY AND PROUD OF IT&lt;/div&gt;
</p></div>
<p>Learn more about floats:</p>
<ul>
<li><a href="http://biz.leoraw.com/2010/12/clear-float/">Clear a float</a></li>
<li><a href="http://www.w3schools.com/css/pr_class_float.asp">CSS float property </a></li>
<li><a href="http://css.maxdesign.com.au/floatutorial/">Floatutorial </a></li>
<li><a href="http://webdesign.about.com/od/beginningcss/ht/htcssfloatleft.htm">How To Float an Image to the Left of Text</a></li>
</ul>
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=1974&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/float-that-image/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Links to tutorials on HTML and CSS</title>
		<link>http://biz.leoraw.com/links-to-tutorials-on-html-and-css/</link>
		<comments>http://biz.leoraw.com/links-to-tutorials-on-html-and-css/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 10:53:40 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[novice]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=1708</guid>
		<description><![CDATA[HTML and CSS are essential tools for building websites.  Learn via online tutorials more about how to master HTML and CSS.]]></description>
			<content:encoded><![CDATA[<p>I put together this page of HTML and CSS tutorials a few years ago when I conducted a teen webmaster class at our library.  The tutorials are still useful for those who would like to learn these essential web building tools.  Click the image below to get to the page:</p>
<p><a href="http://www.hpplnj.org/reference/html_css_links.php"><img src="http://biz.leoraw.com/wp-content/uploads/2010/04/links_css_html.jpg" alt="css and html links" title="links_css_html" width="550" height="366" class="alignnone size-full wp-image-1713" /></a></p>
<p>Feel free to suggest more HTML or CSS links.  If you are serious about learning to build websites, PHP, jQuery and how to set up and tweak any of the big three content management systems (WordPress, Drupal or Joomla!) are also key skills to master.</p>
<div style="float:right; width: 100px;"><img src="http://biz.leoraw.com/wp-content/uploads/2010/04/css_html.jpg" alt="css html" title="css_html" class="bordered" width="100" height="100" class="alignright size-full wp-image-1720" /></div>
<p>Related Posts:</p>
<ul>
<li><a href="http://biz.leoraw.com/2009/11/top-wordpress-code-sites/">Top WordPress Code Sites</a> </li>
<li><a href="http://biz.leoraw.com/2009/10/6-ways-to-learn-jquery/">6 Ways to Learn jQuery</a></li>
</ul>
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=1708&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/links-to-tutorials-on-html-and-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fancy Colored Boxes with CSS</title>
		<link>http://biz.leoraw.com/fancy-colored-boxes-with-css/</link>
		<comments>http://biz.leoraw.com/fancy-colored-boxes-with-css/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 15:40:13 +0000</pubDate>
		<dc:creator>Leora Wenger</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[boxes]]></category>
		<category><![CDATA[curves]]></category>

		<guid isPermaLink="false">http://biz.leoraw.com/?p=468</guid>
		<description><![CDATA[If you like to play with colors, padding and borders, you can easily get fancy boxes with CSS on your web pages.  The HTML markup is simple; it's just a matter of playing with the CSS code. With links to rounded corners (curves) for more advanced CSS and links to introductory tutorials on CSS.]]></description>
			<content:encoded><![CDATA[<p>If you like to play with colors, padding and borders, it&#8217;s easy to get boxes like these:</p>
<div style="padding:3px; border: 1px solid #ccc; background-color: #666;width: 400px;  margin-left:auto; margin-right: auto;">
<div style="border: 1px solid #fff; background-color: #69c; padding: 5px;color: #fff; text-align:center; font-weight: bold; font-variant:small-caps;">Fun Fancy Box</div>
</div>
<div>&nbsp;</div>
<div class="myouter">
<div class="myinner">
<ul>
<li><a href="http://biz.leoraw.com/2009/11/top-wordpress-code-sites/">Top WordPress Code Sites</a></li>
<li><a href="http://biz.leoraw.com/2009/11/research-via-twitter-use-hashtags/">Research via Twitter: Use Hashtags</a></li>
<li><a href="http://biz.leoraw.com/2009/11/navigation-choosing-a-menu/">Navigation: Choosing a Menu</a></li>
</ul>
</div>
</div>
<p>I use these boxes when I need to highlight some links or make a header stand out.  One just has to get a hang of what the code should be, then one can tweak it for one&#8217;s own needs.  You can use these at the top of a post or as a box to highlight links.</p>
<h3>Learning the Code</h3>
<p>Let&#8217;s take a look at the code for that top box.  You will notice two div tags, one wrapped inside the other:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
&lt;div style=&#8221;padding:3px; border: 1px solid #ccc; background-color: #666;width: 400px;  margin-left:auto; margin-right: auto;&#8221;>&lt;div style=&#8221;border: 1px solid #fff; background-color: #69c; padding: 5px;color: #fff; text-align:center; font-weight: bold; font-variant:small-caps;&#8221;>Fun Fancy Box&lt;/div&gt;&lt;/div&gt;
</div>
<p>The above is done with <strong>inline code</strong>.  A better approach is to separate the HTML from the CSS &#8211; so it&#8217;s easier for you to see what is going on.  You can then use the CSS code over and over again. And you will also discover that the two boxes have similar HTML markup:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
&lt;div class=&#8221;myouter&#8221;&gt;&lt;div class=&#8221;myinner&#8221;&gt;stuff here&lt;/div&gt;&lt;/div&gt;
</div>
<p>In the second box, the yellow with red borders, I inserted a &lt;ul&gt; tag with &lt;li&gt; links in the middle:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
<div>&lt;div class=&#8221;myouter&#8221;&gt;&lt;div class=&#8221;myinner&#8221;&gt;</div>
<div style="margin-left: 20px;">&lt;ul&gt;</div>
<div style="margin-left: 40px;">
&lt;li&gt;&lt;a href=&#8221;http://www.somedomain.com/link.htm&#8221;>Link One&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;http://www.somedomain.com/link2.htm&#8221;&gt;Link Two&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&#8221;http://www.somedomain.com/link3.htm&#8221;&gt;Link Three&lt;/a&gt;&lt;/li&gt;
</div>
<div style="margin-left: 20px;">&lt;/ul&gt;</div>
<p>&lt;/div&gt;&lt;/div&gt;
</p></div>
<h3>The CSS Code</h3>
<p>Here is the CSS code for the blue box, which you should save to your stylesheet (if you use WordPress, it&#8217;s <strong>style.css</strong>):</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
/*CODE for FANCY COLORED BOXES (always good to comment your CSS code)<br />
========================================================= */<br />
.myouter {</p>
<div style="margin-left:20px;">padding:3px;<br />
border: 1px solid #ccc;<br />
background-color: #666;<br />
width: 400px;<br />
margin-left:auto;<br />
margin-right: auto;
</div>
<p>}</p>
<p>.myinner {</p>
<div style="margin-left:20px;">border: 1px solid #fff;<br />
background-color: #69c;<br />
padding: 5px;<br />
color: #fff;<br />
text-align:center;<br />
font-weight: bold;<br />
font-variant:small-caps;
</div>
<p>}
</p></div>
<p>The code for the red and yellow box with links is only a slight variation of the blue box.  You will need to add some code for the ul and li tags:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
/*CODE for FANCY COLORED BOXES (red and orangey yellow version)<br />
========================================================= */<br />
.myouter {</p>
<div style="margin-left:20px;">
padding:3px;<br />
background-color: #fff;<br />
width: 400px;<br />
border: 1px solid #900;<br />
margin-left:auto;<br />
margin-right: auto;
</div>
<p>}</p>
<p>.myinner {</p>
<div style="margin-left:20px;">
border: 1px solid #900;<br />
background-color: #ffcc66;<br />
padding: 5px;<br />
color: #900;<br />
font-weight: bold;</div>
<p>}</p>
<p>.myinner ul {</p>
<div style="margin-left:20px;">
margin-top: 5px;<br />
margin-bottom: 5px;</div>
<p>}</p>
<p>.myinner ul li a{</p>
<div style="margin-left:20px;">
color: #900;
</div>
<p>}</p>
<p>.myinner ul li a:hover{</p>
<div style="margin-left:20px;">
color: blue;<br />
text-decoration:underline;</div>
<p>}
</p></div>
<p>If you want both box versions in your stylesheet, name the classes for one of them something other than myinner and myouter.</p>
<p>Note: if you want this to work in your <strong>WordPress theme&#8217;s style.css</strong>, you may have to put the post classes before the <strong>.myinner</strong> and <strong>.myouter</strong> to get this to work.  This is what worked in my style.css:</p>
<div style="padding:10px; border:1px solid #ccc; background-color: #eee;">
.post .entry .myouter {<br />
&#8230;code here&#8230;<br />
}<br />
.post .entry .myinner {<br />
&#8230;code here&#8230;<br />
}
</div>
<h3>Curves: The Next Challenge</h3>
<p>If you want to add <strong>curves</strong>, read some of these wonderful posts:</p>
<ul>
<li><a href="http://www.schillmania.com/content/entries/2009/css3-and-the-future//">CSS 3 and The Future: Image-free Rounded Corners, Drop Shadows and Gradients</a></li>
<li><a href="http://www.infernodevelopment.com/5-methods-css-curvy-corners">5 Methods for CSS Curvy Corners</a></li>
<li><a href="http://www.webdesigndev.com/web-development/12-really-useful-css3-tips-and-techniques">12 Really Useful CSS3 Tips And Techniques</a></li>
</ul>
<h3>Need More Basic? Intro to CSS Links</h3>
<p><img src="http://biz.leoraw.com/wp-content/uploads/2009/12/flowered_boxes-300x117.jpg" alt="flowered_boxes" title="flowered_boxes" width="300" height="117" class="alignright size-medium wp-image-563" /></p>
<ul>
<li><a href="http://www.w3schools.com/css/">CSS Tutorial</a></li>
<li><a href="http://www.w3.org/Style/Examples/011/firstcss">Starting with HTML + CSS</a></li>
</ul>
<p><img src="http://biz.leoraw.com/wp-content/uploads/2009/12/put_an_image.jpg" alt="put_an_image" title="put_an_image" width="300" height="136" class="alignleft size-full wp-image-567" /></p>
<img src="http://biz.leoraw.com/?ak_action=api_record_view&id=468&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://biz.leoraw.com/fancy-colored-boxes-with-css/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

