<?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>Web Masters Wall&#187; CSS Category on WMW</title>
	<atom:link href="http://webmasterswall.com/topics/css/feed" rel="self" type="application/rss+xml" />
	<link>http://webmasterswall.com</link>
	<description>Website Templates, Flash Templates and Other Products</description>
	<lastBuildDate>Mon, 09 Nov 2009 21:20:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Style Ordered List with CSS</title>
		<link>http://webmasterswall.com/css/style-ordered-list</link>
		<comments>http://webmasterswall.com/css/style-ordered-list#comments</comments>
		<pubDate>Mon, 03 Nov 2008 21:40:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[change text color]]></category>
		<category><![CDATA[css tutorial]]></category>
		<category><![CDATA[default numbers]]></category>
		<category><![CDATA[different style]]></category>
		<category><![CDATA[font style]]></category>
		<category><![CDATA[ol element]]></category>
		<category><![CDATA[Ordered List with CSS]]></category>
		<category><![CDATA[Style Ordered Lis]]></category>

		<guid isPermaLink="false">http://codeasily.allforblogs.com/?p=18</guid>
		<description><![CDATA[If you want to use something different from the default numbering of ordered lists, then all you have to do is choose a different style for your lists. CSS allows you to select from a wide variety of different list item shapes. For exampe, ordered list styles: decimal (default), lower-alpha, upper-alpha, lower-roman, upper-roman and none. [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use something different from the default numbering of ordered lists, then all you have to do is choose a different style for your lists. CSS allows you to select from a wide variety of different list item shapes. For exampe, ordered list styles: decimal (default), lower-alpha, upper-alpha, lower-roman, upper-roman and none.</p>
<p>By default, most browsers display the ordered list numbers same font style as the body text. But what if I want change style only ordered list numbers. Here is a quick CSS tutorial on how you can use the ordered list <code>&lt;ol&gt;</code> and paragraph <code>&lt;p&gt;</code> element to design a stylish numbered list.<br />
<span id="more-18"></span></p>
<h3>Overview</h3>
<p>Basically, all what we need to do is style the <code>&lt;ol&gt;</code> element to Georgia font and set background image, and then reset the <code>&lt;p&gt;</code> element (nested in <code>&lt;ol&gt;</code>) to Arial. By default numbers of ordered list positioned outside of <code>&lt;ol&gt;</code> element. So if you want numbers lie on background, you need to set left margin to <code>&lt;li&gt;</code> element. I have to add left padding to <code>&lt;li&gt;</code> element in my example, to separate text from background image.</p>
<div class="image-map" style="height: 220px; width:455px;"><img src="http://webmasterswall.com/wp-content/uploads/stylish-list.gif" alt="overview" />
<ul>
<li class="nobg"><a href="#nogo"><strong>Let&#8217;s begin&#8230;</strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list1.gif" alt="" /></em></a></li>
<li><a href="#nogo"><strong>&#8230; set background image&#8230;</strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list2.gif" alt="" /></em></a></li>
<li><a href="#nogo"><strong>&#8230; change font style&#8230;</strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list3.gif" alt="" /></em></a></li>
<li><a href="#nogo"><strong>&#8230; reset margin and padding&#8230;</strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list4.gif" alt="" /></em></a></li>
<li class="higher"><a href="#nogo"><strong>&#8230; change color of numbers&#8230;</strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list5.gif" alt="" /></em></a></li>
<li><a href="#nogo"><strong>&#8230; move numbers under background&#8230; </strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list6.gif" alt="" /></em></a></li>
<li class="higher"><a href="#nogo"><strong>&#8230; separating text from background&#8230;</strong><em><img src="http://codeasily.allforblogs.com/wp-content/uploads/stylish-list7.gif" alt="" /></em></a></li>
<li><a href="#nogo"><strong>&#8230; change font style for text&#8230;</strong><em><img src="http://webmasterswall.com/wp-content/uploads/stylish-list8.gif" alt="" /></em></a></li>
<li><a href="#nogo"><strong>&#8230; change text color.</strong></a></li>
</ul>
</div>
<h3><em>1.</em> HTML source code</h3>
<p>Make an ordered list. Don’t forget to wrap your text with a <code>&lt;p&gt;</code> tag.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;This is first line&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Here is second line&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;And last line&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;</pre></div></div>

<p>Here is how the default ordered list will display:</p>
<p class="image"><img src="http://webmasterswall.com/wp-content/uploads/ol-1.gif" alt="step 1" /></p>
<h3><em>2.</em> ol element</h3>
<p>Style the <code>ol</code> element:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ol <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">italic</span> <span style="color: #933;">1em</span> Georgia<span style="color: #00AA00;">,</span> Times<span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>The list will become like this:</p>
<p class="image"><img src="http://webmasterswall.com/wp-content/uploads/ol-2.gif" alt="step 2" /></p>
<h3><em>3.</em> ol p element</h3>
<p>Now style the <code>ol p</code> element:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">ol p <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">normal</span> <span style="color: #933;">.8em</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;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Your final list should look like this:</p>
<p class="image"><img src="http://webmasterswall.com/wp-content/uploads/ol-3.gif" alt="step 3" /></p>
<p>You can also add background under numbers. Don’t forget to reset margin for <code>ol</code> and <code>ol p</code> elements and add it to <code>ol li</code> element.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">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;">#555555</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
&nbsp;
&nbsp;
&nbsp;
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
p <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
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;">#ffffff</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;">40px</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;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This is how it look like now:</p>
<p class="image"><img src="http://webmasterswall.com/wp-content/uploads/ol-4.gif" alt="step 4" /></p>
<p>View my <a class="thickbox" title="Ordered List" href="http://webmasterswall.com/demo/ordered-list/ordered-list.html?TB_iframe=true&amp;height=400&amp;width=700">demo file</a> to see more samples.</p>
]]></content:encoded>
			<wfw:commentRss>http://webmasterswall.com/css/style-ordered-list/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
