<?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>CSS Tutorial &#187; CSS Misc</title>
	<atom:link href="http://www.csstutorial.net/category/css-misc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csstutorial.net</link>
	<description>CSS Tutorial</description>
	<lastBuildDate>Mon, 30 Jan 2012 06:00:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Centering Text with CSS</title>
		<link>http://www.csstutorial.net/2010/06/centering-text-with-css/</link>
		<comments>http://www.csstutorial.net/2010/06/centering-text-with-css/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 00:29:25 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[centering text]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=881</guid>
		<description><![CDATA[Centering text and other elements can easily be done with the CSS text-align property. It can be applied to a division, the p tag - pretty much any block-level element.]]></description>
			<content:encoded><![CDATA[<p>Centering text and other elements can easily be done with the CSS text-align property. It can be applied to a division, the p tag &#8211; pretty much any block-level element.</p>
<p>Applying this to an internal or external stylesheet:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">p <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></pre></div></div>

<p>or this to inline styling:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p style=&quot;text-align: center;&quot;&gt;This is centered text&lt;/p&gt;</pre></div></div>

<p style="text-align: center;">will center your text.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/06/centering-text-with-css/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The CSS Overflow Property</title>
		<link>http://www.csstutorial.net/2010/06/the-css-overflow-property/</link>
		<comments>http://www.csstutorial.net/2010/06/the-css-overflow-property/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 13:07:27 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[overflow auto]]></category>
		<category><![CDATA[overflow hidden]]></category>
		<category><![CDATA[overflow visible]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=833</guid>
		<description><![CDATA[By default, elements in a website will expand to make room for whatever they contain. An empty division, for example, won't show at all, but you can add 1 or 12 (whatever) paragraphs, and the division will be as big as it needs to be so everything inside is displayed.]]></description>
			<content:encoded><![CDATA[<p>By default, elements in a website will expand to make room for whatever they contain. An empty division, for example, won&#8217;t show at all, but you can add 1 or 12 (whatever) paragraphs, and the division will be as big as it needs to be so everything inside is displayed.</p>
<p>But what happens if the dimensions of an element &#8211; let&#8217;s use a division for this demonstration &#8211; are set?</p>
<div style="width: 200px; height: 100px; background: #ededed;">
<p>This division is set at a height and width of 100 and 200 pixel, respectively, and it has a colored background to display its dimension.</p>
</div>
<p>The code that creates this looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 200px; height: 100px; background: #ededed;&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>This division is set at a height and width of 100 and 200 pixel,
respectively, and it has a colored background to display its dimension.
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>In this example, overflow is no issue, there is nothing here to overflow.  But what happens, if I add more content than this little box can hold?</p>
<div style="width: 200px; height: 100px; background: #ededed;">
<p>Es war einmal ein kleines süßes Mädchen, das hatte jedermann lieb, der es nur ansah, am allerliebsten aber ihre Großmutter, die wußte gar nicht, was sie alles dem Kinde geben sollte. Einmal schenkte sie ihm ein Käppchen von rotem Sammet, und weil ihm das so wohl stand und es nichts anders mehr tragen wollte, hieß es nur das Rotkäppchen.</p>
</div>
<p>My cup overfloweth! And this is where the overflow property comes into play.  As you see, there is no overflow property applied to the above.</p>
<p>My cup overfloweth! And this is where the overflow property comes into play.  As you see, there is no overflow property applied to the above.</p>
<p>My cup overfloweth! And this is where the overflow property comes into play.  As you see, there is no overflow property applied to the above.</p>
<p>Geesh, I had to say that three times just to clear my overflow so one can actually read what is written.  But it makes the point nicely &#8211; If you stick more content into a container than it can hold, you have a problem!</p>
<p>This is where the overflow property comes into play. As you see, there is no overflow property applied to the above, but the division is responding to the default, which is</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">visible</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So I need to decide what to do with this overflow.  One option is to hide it by applying &#8216;overflow: hidden&#8217; to the CSS.  In an internal or external stylesheet, the styling for our example division would then look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;">div {
height: 100px;
width: 200px;
background: #EDEDED;
overflow: hidden;
}</pre></div></div>

<p>And as we look at the result of this, it&#8217;s easy to realize what kind of problem we now have:</p>
<div style="width: 200px; height: 100px; background: #ededed; overflow: hidden;">
<p>Es war einmal ein kleines süßes Mädchen, das hatte jedermann lieb, der es nur ansah,  am allerliebsten aber ihre Großmutter, die wußte gar nicht, was sie alles dem Kinde geben sollte. Einmal schenkte sie ihm ein Käppchen von rotem Sammet, und weil ihm das so wohl stand und es nichts anders mehr tragen wollte, hieß es nur das Rotkäppchen.</p>
</div>
<p>Obviously, this creates a whole new issue:  Now, part of the text has disappeared, and unless folks look at the source &#8211; and who, with the exception of us geeks, would do that??? &#8211; they will never know what else you had to say.</p>
<p>Good news is that in addition to &#8216;visible&#8217; and &#8216;hidden&#8217;, which we explored above, there are two additional values to chose from: &#8216;scroll&#8217; and &#8216;auto&#8217;. &#8216;Scroll&#8217; will create a horizontal AND a vertical scrollbar to the box, whether one is needed or not.</p>
<div style="width: 200px; height: 100px; background: #ededed; overflow: scroll;">
<p>This division is set at a height and width of 100 and 200 pixel, respectively.</p>
</div>
<p>That doesn&#8217;t make much sense. Why put a scrollbar if there&#8217;s nothing to scroll to? But if you think that you would know, as you design your site, if your content will fit into its element or not, you are not 100% correct.  Things may or may not fit when YOU look at them, but you can never be sure exactly how all the folks visiting have their settings adjusted and how things look to them.  With that in mind </p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>is the perfect solution.  A srollbar will appear if one is needed:</p>
<div style="width: 200px; height: 100px; background: #ededed; overflow: auto;">
<p>Es war einmal ein kleines süßes Mädchen, das hatte jedermann lieb, der es nur ansah, am allerliebsten aber ihre Großmutter, die wußte gar nicht, was sie alles dem Kinde geben sollte. Einmal schenkte sie ihm ein Käppchen von rotem Sammet, und weil ihm das so wohl stand und es nichts anders mehr tragen wollte, hieß es nur das Rotkäppchen.</p>
</div>
<p>And not, if it&#8217;s not needed:</p>
<div style="width: 200px; height: 100px; background: #ededed; overflow: auto;">
<p>This division is set at a height and width of 100 and 200 pixel, respectively.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/06/the-css-overflow-property/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Styling a Horizontal Rule with CSS</title>
		<link>http://www.csstutorial.net/2010/06/styling-a-horizontal-rule-with-css/</link>
		<comments>http://www.csstutorial.net/2010/06/styling-a-horizontal-rule-with-css/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 13:05:08 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[horizontal rule]]></category>
		<category><![CDATA[hr]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=821</guid>
		<description><![CDATA[A quick and easy way to insert a dividing line into a website is with a horizontal rule, the hr tag.]]></description>
			<content:encoded><![CDATA[<p>A quick and easy way to insert a dividing line into a website is with a horizontal rule, the hr tag.</p>
<p>This horizontal rule</p>
<hr style="color: #f00; background: #f00; width: 75%; height: 5px;">
<p>was created by the following inline CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;hr style<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;color: #f00; background: #f00; width: 75%; height: 5px;&quot;</span><span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>It could also be styled in your internal or external stylesheet (which is usually the better approach):</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">hr <span style="color: #00AA00;">&#123;</span>
     <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f00</span><span style="color: #00AA00;">;</span>
     <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f00</span><span style="color: #00AA00;">;</span> 
     <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">75</span>%</span><span style="color: #00AA00;">;</span> 
     <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Note that color AND background-color are applied.  This is necessary, as some browsers use the background-color, others (IE) the color element to apply color to the rule.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/06/styling-a-horizontal-rule-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling iframes with CSS</title>
		<link>http://www.csstutorial.net/2010/06/styling-iframes-with-css/</link>
		<comments>http://www.csstutorial.net/2010/06/styling-iframes-with-css/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 19:23:41 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=746</guid>
		<description><![CDATA[If you still haven't heard, hear it now:  <strong>FRAMES ARE DEAD</strong> - well, technically, they are more like the undead - the zombies of webdesign.  They should be gone and forgotten but refuse to stay buried.  It's much better not to use them. However, there may be a situation, where inserting a separate html document into your page makes sense.]]></description>
			<content:encoded><![CDATA[<p>If you still haven&#8217;t heard, hear it now:  <strong>FRAMES ARE DEAD</strong> &#8211; well, technically, they are more like the undead &#8211; the zombies of webdesign.  They should be gone and forgotten but refuse to stay buried.  It&#8217;s much better not to use them.</p>
<p>However, there may be a situation, where inserting a separate html document into your page makes sense. And there&#8217;s an app for that:  <strong>Iframes</strong> (aka inline frames).  This code inserts a basic page into an html page:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">iframe</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.killersites.com/&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Your browser does not support iframes.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">iframe</span>&gt;</span></pre></div></div>

<p>At this point, there is absolutely no styling applied to the iframe, and it looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/06/iframes01.html'>like this</a>. Note the line regarding lack of browser support. Iframes are supported by all the major browsers, but it&#8217;s a good idea to add this for the odd browser that doesn&#8217;t.</p>
<p>While I am a strong supporter of using the HTML strict doctype and writing validating, standard-compliant code &#8211; iframes will not validate, which leaves us with two options:  Either suck up the iframe-related validation errors or switch to HTML transitional doctype for the pages with iframes.</p>
<p>CSS gives you the power to dress your iframe up a bit. The following attributes are available:</p>
<ul>
<li>src (the URL of your iframe)</li>
<li>longdesc (this specifies the URL of the iframe, but is hardly supported and can just as well be ignored)</li>
<li>name (obviously, the name of your iframe)</li>
<li>height (the height of your iframe)</li>
<li>width (the width of your iframe)</li>
<li>frameborder (1 or 0 &#8211; 1 is for yes, 0 for no)</li>
<li>marginheight (determines the top and bottom margin of your iframe)</li>
<li>marginwidth (determines right and left margins of your iframe</li>
<li>scrolling (Do you want a scrollbar? Yes, no, or auto &#8211; &#8216;Yes&#8217;, is obvious. &#8216;No&#8217; should not be used &#8211; what if someone does not see the entire content?  If this is set to &#8216;no&#8217;, that viewer can never get to the hidden parts of what you&#8217;re inserting. &#8216;Auto&#8217; lets the browser decide if one is needed and seems the best option here to me.)</li>
<li>(align) &#8211; I&#8217;m just mentioning this for completeness; it has been deprecated.  Don&#8217;t use it.</li>
</ul>
<p>So this inline CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;iframe src<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;http://www.killersites.com&quot;</span> 
name<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;Killersites.com&quot;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;400px&quot;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;700px&quot;</span> 
frameborder<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;0&quot;</span> marginheight<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;20&quot;</span> marginwidth<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;35&quot;</span> 
scrolling<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;auto&quot;</span><span style="color: #00AA00;">&gt;</span>
&lt;p<span style="color: #00AA00;">&gt;</span>Your browser does not support iframes.&lt;/p<span style="color: #00AA00;">&gt;</span>
&lt;/iframe<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/06/iframes02.html'>Gives you that</a>. And if you add a bit more CSS to the frame itself:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">iframe <span style="color: #00AA00;">&#123;</span>
 <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">95px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/06/iframes03.html'>you can position the entire frame where you want it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/06/styling-iframes-with-css/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Multiple Background Images with CSS</title>
		<link>http://www.csstutorial.net/2010/05/multiple-background-images-with-css/</link>
		<comments>http://www.csstutorial.net/2010/05/multiple-background-images-with-css/#comments</comments>
		<pubDate>Sat, 08 May 2010 11:48:48 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[multiple background images]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=655</guid>
		<description><![CDATA[At times, it makes more sense to use background images than to insert them directly into the page.  And while each element - like your body tag - can hold only one background image, they can be applied to several elements.]]></description>
			<content:encoded><![CDATA[<p>At times, it makes more sense to use background images than to insert them directly into the page.  And while each element &#8211; like your body tag &#8211; can hold only one background image, they can be applied to several elements.</p>
<p>But pretty much every selector can hold a background image.  On <a href='http://www.csstutorial.net/wp-content/uploads/2010/05/multiple-background-images.html'>THIS PAGE</a>, I have added the image to the html tag, the body tag, and the h1 and h2 tags (these are &#8216;selectors&#8217;) &#8211; like so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
html <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-y</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h1 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">bgimage.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span> <span style="color: #cc00cc;">#ffc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">150px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">250px</span><span style="color: #00AA00;">;</span> 
<span style="color: #808080; font-style: italic;">/*I'm using the right and left padding of the wrapper to keep
the content off the images */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Note that I&#8217;m a bit lazy at the moment, and am using the same image for all four selectors.  Taking a closer look at each of them, also shows a bit more how things work:</p>
<p>The html tag (image displayed on the left) repeats the flower all the way down the monitor, regardless of how much content there is.  Resize your window and see what happens.</p>
<p>The body tag, where the image is displayed to the right, only shows the image as far as the content goes.</p>
<p>The h1 tag only shows as much of the image as the space its content is taking up.</p>
<p>The h2 tag also has some height added to it (exactly 150px, the height of the background image), so it does show the entire image.  I&#8217;ve also added the background color to more clearly demonstrate the space that&#8217;s taken up by h2.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/05/multiple-background-images-with-css/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Styling Lists with CSS</title>
		<link>http://www.csstutorial.net/2010/04/styling-lists-with-css/</link>
		<comments>http://www.csstutorial.net/2010/04/styling-lists-with-css/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 23:50:03 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[ordered lists]]></category>
		<category><![CDATA[styling list items]]></category>
		<category><![CDATA[unordered lists]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=659</guid>
		<description><![CDATA[We've already discussed navigation lists and list bullet images, but sometimes, a list is just a list. There are two types - the ordered list and the unordered list. The ordered list counts the items; the unordered list marks the individual items with bullets or other markers. The HTML is simple.]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve already discussed navigation lists and list bullet images, but sometimes, a list is just a list. There are two types &#8211; the ordered list and the unordered list. The ordered list counts the items; the unordered list marks the individual items with bullets or other markers. The HTML is simple.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ol</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ol</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>And, without any styling applied at all, that looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists01.html'>Like This</a>.</p>
<p>We can affect the list item markers with some simple CSS and the list-style-property controls those.  For unordered lists, we can chose between ul styles: disc, square, circle, or none  &#8211; <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists02.html'>which looks like this</a>, or between ol styles: decimal, decimal-leading-zero, lower-roman, upper-roman, lower-alpha, upper-alpha, lower-greek, upper-greek, lower-latin, upper-latin, armenian, or georgian, <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists03.html'>which looks like that</a>.</p>
<p>Other than that, we can style the ul tag and the li tag.  Anything added to the ul tag, affects the entire list, where properties applied to the li tag will affect the individual list items. So this CSS</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ffe566</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ol <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#828772</span><span style="color: #00AA00;">;</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: #00AA00;">&#125;</span>
&nbsp;
ul li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fc6</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ol li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9cc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists04.html'>will create that</a>.</p>
<p>(Note that I had to add the &#8216;ul&#8217; or &#8216;ol&#8217; in front of the &#8216;li&#8217; so I could target specifically either list&#8217;s items.  Had I just used &#8216;li&#8217;, any styling would have affected all of them regardless.) &hellip; <a href='http://www.csstutorial.net/wp-content/uploads/2010/04/lists05.html'>example: adding a larger font size to &#8216;just li&#8217;</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/04/styling-lists-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Borders with CSS</title>
		<link>http://www.csstutorial.net/2010/04/how-to-add-borders-to-images-with-css/</link>
		<comments>http://www.csstutorial.net/2010/04/how-to-add-borders-to-images-with-css/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 21:22:55 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[image border with CSS]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=638</guid>
		<description><![CDATA[Sometimes, a website design benefits when images have frames - or borders.  One way to get them is one image at a time, using a graphics program.  But there is a much faster way - with CSS!]]></description>
			<content:encoded><![CDATA[<p>Sometimes, a website design benefits when images have frames &#8211; or borders.  One way to get them is one image at a time, using a graphics program.  But there is a much faster way &#8211; with CSS!</p>
<p>This code:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;image.jpg&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;350px&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;262px&quot;</span> </span>
<span style="color: #009900;"><span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Rusty Stove in Luckenbach, Texas&quot;</span>&gt;</span></pre></div></div>

<p>inserts a plain image into your page:</p>
<p><img src="http://www.csstutorial.net/wp-content/uploads/2010/04/luckenbach.jpg" alt="" title="Rusty Stove in Luckenbach, Texas - with chicken" width="350" height="262" class="aligncenter size-full wp-image-640" />
<p>And if we add this to our CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#7d6b72</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border-width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Then our image appears like this:</p>
<p><img style="border: solid 5px #7d6b72;" src="http://www.csstutorial.net/wp-content/uploads/2010/04/luckenbach.jpg" alt="" title="Rusty Stove in Luckenbach, Texas - with chicken" width="350" height="262" class="aligncenter size-full wp-image-640" />
<p>Actually, I would use shortcuts and write my CSS like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">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;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#7d6b72</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/04/how-to-add-borders-to-images-with-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding Comments to CSS</title>
		<link>http://www.csstutorial.net/2010/04/css-comments/</link>
		<comments>http://www.csstutorial.net/2010/04/css-comments/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 10:41:03 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[CSS Comments]]></category>
		<category><![CDATA[Hidden CSS Comments]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=605</guid>
		<description><![CDATA[Comments in a stylesheet are a good idea.  Often, things that are obvious as you write them, make no sense a week or even years later - or to somebody else.  So it can be very helpful to include explanations.  However, we don't want to browser to read and render those, as they are not meant to be displayed on the webpage, so we have to hide them.]]></description>
			<content:encoded><![CDATA[<p>Comments in a stylesheet are a good idea.  Often, things that are obvious as you write them, make no sense a week or even years later &#8211; or to somebody else.  So it can be very helpful to include explanations.  However, we don&#8217;t want to browser to read and render those, as they are not meant to be displayed on the webpage, so we have to hide them.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
This is a HIDDEN Comment!
*/</span></pre></div></div>

<p>That&#8217;s all it takes &#8211; a &#8216;/*&#8217; to start, and a &#8216;*/&#8217; to end.  A few handy applications for these hidden comments are:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">h1 <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* black - because I forget */</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Another handy use for the comments are to help define the structure, so things are easier to find:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* ----------------- Generic Styles ------------------ */</span>
&nbsp;
<span style="color: #6666ff;">.alignleft</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: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.alignright</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;">right</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.clear</span> <span style="color: #00AA00;">&#123;</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: #00AA00;">&#125;</span>
&nbsp;
p <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">15px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
h1<span style="color: #00AA00;">,</span> h2<span style="color: #00AA00;">,</span> h3 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Baskerville<span style="color: #00AA00;">,</span> Garamond<span style="color: #00AA00;">,</span> Palatino<span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Palatino Linotype&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Hoefler Text&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h2<span style="color: #00AA00;">,</span>  h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span> <span style="color: #933;">20px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9e6548</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;">2em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
h3 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</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;">25px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9e6548</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f7efe3</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
ul <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* ----------------- The Header -------------- */</span>
&nbsp;
<span style="color: #cc00cc;">#header</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;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">pics/stove.jpg</span><span style="color: #00AA00;">&#41;</span> <span style="color: #cc00cc;">#f7efe3</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">top</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span>
	-moz-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
	-webkit-border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
	border-radius<span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#header</span> h1 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9e6548</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;">3em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span> <span style="color: #933;">25px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* ------------- Top Navigation ------------------- */</span>
&nbsp;
<span style="color: #cc00cc;">#topnav</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;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">pics/nav.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">repeat-x</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Geneva<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-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;">1.2em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">679px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">55px</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: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#topnav</span> li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* ------------ content -------------- */</span>
&nbsp;
<span style="color: #cc00cc;">#content</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#contentPage</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#indexPage</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;">635px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">35px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#contentPage</span> h2<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#search</span> h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-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;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#contentPage</span> h3<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#search</span> h3 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* ----------- Sidebar ---------------- */</span>
&nbsp;
<span style="color: #cc00cc;">#sidebar</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;">205px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9e6548</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f7efe3</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#sidebar</span> h1<span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#sidebar</span> h2 <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.4em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span> <span style="color: #933;">5px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f7efe3</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* ------------- footer ----------------------- */</span>
&nbsp;
<span style="color: #cc00cc;">#footer</span> <span style="color: #00AA00;">&#123;</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;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">40px</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;">.8em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#9e6548</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f7efe3</span><span style="color: #00AA00;">;</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>
&nbsp;
<span style="color: #cc00cc;">#footer</span> p <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">14px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>I&#8217;m sure you get the idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/04/css-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Position Text around an Image with CSS</title>
		<link>http://www.csstutorial.net/2010/03/how-to-position-text-around-an-image-with-css/</link>
		<comments>http://www.csstutorial.net/2010/03/how-to-position-text-around-an-image-with-css/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 13:47:57 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[CSS Page Layouts]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[floating image; flow text around image]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=585</guid>
		<description><![CDATA[It's always nice to have some pictures to go along with your text.  However, if you just use the html to insert a photo into your text flow, you'll find that it breaks up the flow of your text and just plops itself ungracefully right in the middle of your paragraph without rhyme or reason.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always nice to have some pictures to go along with your text.  However, if you just use the html to insert a photo into your text flow, you&#8217;ll find that it <img src="http://www.csstutorial.net/wp-content/uploads/2010/03/leia.jpg" alt="German Shepherd taking a nap"> breaks up the flow of your text and just plops itself ungracefully right in the middle of your paragraph without rhyme or reason.</p>
<p>Fortunately, a little bit of CSS positioning can help us out here. Adding this to your CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img <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: #00AA00;">&#125;</span></pre></div></div>

<p>will make the same thing look <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/image-float.html'>like this</a>.</p>
<p>Now all we have to do is add some margin or padding to create a bit of space around the image</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img <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;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">25px</span> <span style="color: #933;">25px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p><a href='http://www.csstutorial.net/wp-content/uploads/2010/03/image-float21.html'>And here you go</a>.
<p>However, if you use the image tag for your CSS, all the images in your site will float.  Since this is a Basic CSS tip, I&#8217;ve used it for demonstration purposes only.  A more practical approach would be to add a special class to the images you want to float.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;floating&quot;</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.csstutorial.net/wp-content/uploads/2010/03/leia.jpg&quot;</span></span>
<span style="color: #009900;"> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;German Shepherd taking a nap&quot;</span>&gt;</span></pre></div></div>

<p>and write the CSS like this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">img<span style="color: #6666ff;">.floating</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;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">25px</span> <span style="color: #933;">25px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/03/how-to-position-text-around-an-image-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying Bullet Images with CSS</title>
		<link>http://www.csstutorial.net/2010/03/how-to-use-css-to-display-bullet-images/</link>
		<comments>http://www.csstutorial.net/2010/03/how-to-use-css-to-display-bullet-images/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 12:17:53 +0000</pubDate>
		<dc:creator>Andrea Barnett</dc:creator>
				<category><![CDATA[CSS Basics]]></category>
		<category><![CDATA[CSS Misc]]></category>
		<category><![CDATA[Killer CSS Tips and Tricks]]></category>
		<category><![CDATA[bullet image]]></category>
		<category><![CDATA[bullet list]]></category>

		<guid isPermaLink="false">http://www.csstutorial.net/?p=563</guid>
		<description><![CDATA[With CSS, you have several options for styling list bullets.  For example, disk, circle, square, etc. But what if you want to use a specific image for your bullet?  With CSS, you can do just that.]]></description>
			<content:encoded><![CDATA[<p>With CSS, you have several options for styling list bullets.  For example, disk, circle, square, etc. But what if you want to use a specific image for your bullet?  With CSS, you can do just that.</p>
<p>The code for your basic, unordered list, is this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item 1<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item 2<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item 3<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item 4<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item 5<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>List Item 6<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></pre></div></div>

<p>And it creates your <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/bullets01.html'>Basic Unordered List</a>.</p>
<p>In order to display a custom bullet image, we add this to our CSS:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
         <span style="color: #000000; font-weight: bold;">list-style-image</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">flower.gif</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Which gives us a list which looks <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/bullets02.html'>like this</a>. And you will notice a problem &#8211; my flower and my text just don&#8217;t line up properly.  That is, they align at the bottom and not vertically centered as one would expect.  I guess we could make the image smaller, but at that rate, it would have to be so small, nobody can see what it is, and we might as well use a standard circle.  Or we can <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/bullets03.html'>increase the font size</a>, but that probably won&#8217;t work in relation to the rest of the design.  Adding padding or margin would not help, either, as that adds to both the bullet image AND the text at the same rate, and neither would increasing the line height. </p>
<p>So while we wait and hope for some future development to address this issue, we have a way now to get this to look right.  First, we get rid of our bullets altogether:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ul <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;"><span style="color: #cc66cc;">350</span>%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Note that I&#8217;m also increasing the line height, which may or may not be necessary, depending on your font size in relation to your image size.  If you need line-height, you&#8217;ll just have to play around a bit until things look right. And then, we add a background image to our list:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">flower.gif</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>but if this is all we do, we end up with our flower across the entire line and with our text sitting on top of it.  So we also need:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">li <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">flower.gif</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #993333;">center</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">70px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The &#8216;no-repeat&#8217; tells our image to do exactly that, the &#8216;center left&#8217; positions the image vertically centered and left aligned, and in order to get the text to move NEXT to the image, I&#8217;ve added some padding.  And here you have a <a href='http://www.csstutorial.net/wp-content/uploads/2010/03/bullets04.html'>Perfectly Styled List Using Bullet Images</a>, just not achieved quite the way you might have first expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csstutorial.net/2010/03/how-to-use-css-to-display-bullet-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

