<?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>John Hunt&#039;s web log &#187; li</title>
	<atom:link href="http://john-hunt.com/tag/li/feed/" rel="self" type="application/rss+xml" />
	<link>http://john-hunt.com</link>
	<description>Linux, open source, development, coding, beer and other stuff</description>
	<lastBuildDate>Wed, 22 Jun 2011 23:08:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Fluid horizontal list based highlighting menu with icons</title>
		<link>http://john-hunt.com/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/</link>
		<comments>http://john-hunt.com/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 02:18:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fluid]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[li]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[ul]]></category>

		<guid isPermaLink="false">http://john-hunt.com/programming/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/</guid>
		<description><![CDATA[No doubt it&#8217;s been done elsewhere, but I spent quite a while trying to get this one working. Basically I wanted a horizontal css menu with decent markup and no hacks. I also wanted to have nice icons for each item correctly vertically aligned. On top of that I wanted the whole thing to be [...]]]></description>
			<content:encoded><![CDATA[<p>No doubt it&#8217;s been done elsewhere, but I spent quite a while trying to get this one working. Basically I wanted a horizontal css menu with decent markup and no hacks. I also wanted to have nice icons for each item correctly vertically aligned. On top of that I wanted the whole thing to be fluid so it would look right at any text size. Unfortunately because of IE6&#8242;s lack of support for :hover on anything but links I needed to use containing spans for the text on each list item (doh!) I guess you could use javascript or something instead, but that&#8217;d be really horrid!</p>
<p>After a lot of hair pulling, I finally got it to work:<br />
<img src='http://john-hunt.com/wp-content/uploads/2008/02/menu1.png' alt='Menu' /></p>
<pre>
#navigation ul {
  margin:               0;
  padding:              0;
  background-color:     #eee;
  height:               2em;
  border-bottom:        1px solid #888;
}

#navigation li {
  float:                left;
  list-style-type:      none;
  border-right:         1px solid #888;
}

#navigation a {
  float:                left;
  margin:               0;
  background-repeat:    no-repeat;
  background-position:  5px 50%;
  text-decoration:      none;
  color:                #333;
}

#navigation .inner {
  padding:              0 .4em 0 26px;  /* Adjust based on the width of icon + 10px */
  display:              inline;
  line-height:          2em;
  vertical-align:       middle;
}

#navigation .contacts {
  background-image: url(/crm/resources/icons/contacts.png)
}

#navigation .activities {
  background-image: url(/crm/resources/icons/activities.png)
}

#navigation .reports {
  background-image: url(/crm/resources/icons/reports.png)
}

#navigation .utilities {
  background-image: url(/crm/resources/icons/utilities.png)
}

#navigation a:hover {
  background-color:         #fff;
}</pre>
<p>And here&#8217;s the HTML:</p>
<pre>
&lt;div id="navigation"&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href="" class="contacts"&gt;&lt;span class="inner"&gt;Contacts&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="" class="activities"&gt;&lt;span class="inner"&gt;Activities&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="" class="reports"&gt;&lt;span class="inner"&gt;Reports&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="" class="utilities"&gt;&lt;span class="inner"&gt;Utilities&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>*I got my icons from the fantastic <a href="http://www.famfamfam.com">FamFamFam</a> web site. This guy gives away loads of great icons for free. You might want to convert them to transparent gifs though as obviously IE6- won&#8217;t handle the transparency in the PNGs.</p>
<p>I&#8217;m no css expert, so if you can see anything silly in the css/markup or know of some way of improving this, please drop me a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://john-hunt.com/2008/02/28/fluid-horizontal-list-based-highlighting-menu-with-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

