<?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>Paul Randall &#187; tutorial</title>
	<atom:link href="https://paulrandall.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>https://paulrandall.com</link>
	<description>Experimenting for a living.</description>
	<lastBuildDate>Sat, 15 Mar 2025 15:32:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Centre Aligned List Items</title>
		<link>https://paulrandall.com/2010/06/03/centre-aligned-list-items/</link>
		<comments>https://paulrandall.com/2010/06/03/centre-aligned-list-items/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 21:17:33 +0000</pubDate>
		<dc:creator><![CDATA[Paul]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://prandall.com/?p=358</guid>
		<description><![CDATA[This post has come from a quick bit of experimentation, trying to centre align list items. The design called for centerally aligned list item links, and there could be 3, 4, 5 or more links. Initially I was stumped as to how to create this effect. I had considered a left margin to create the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><strong>This post has come from a quick bit of experimentation, trying to centre align list items.</strong></p>
<p>The design called for centerally aligned list item links, and there could be 3, 4, 5 or more links. Initially I was stumped as to how to create this effect. I had considered a left margin to create the illusion of centre aligning for each possible number, but I knew there was a better way. I&#8217;m always aiming for a solution that works in the older browsers too, and this includes IE6. I don&#8217;t know why I do it to myself, especially as it apparently <a href="http://mashable.com/2010/06/01/ie6-below-5-percent/">only has less than a 5% market share</a> nowadays.</p>
<p><span id="more-358"></span></p>
<h2>The Example</h2>
<p>I&#8217;ll cut to the chase; here is the HTML and CSS.</p>
<p><a href="https://paulrandall.com/experimental/centre-ul/">https://paulrandall.com/experimental/centre-ul/</a></p>
<h3>So How Does It Work?</h3>
<p>On the UL, I am centre aligning the text, effectively making all the content aligning this way. That&#8217;s the real key to it, second only to display:inline on the LI, because a float will push everything to the left.</p>
<p>Below is all the CSS you need</p>
<p><code><br />
ul{text-align:center;}<br />
li{display:inline;}<br />
</code></p>
<p>Simples!</p>
]]></content:encoded>
			<wfw:commentRss>https://paulrandall.com/2010/06/03/centre-aligned-list-items/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
