<?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>FatBasturd &#187; a:hover</title>
	<atom:link href="http://www.fatbasturd.co.uk/tag/ahover/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fatbasturd.co.uk</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 20 Aug 2009 10:58:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sliding Doors Navigation Explained &amp; Demonstrated</title>
		<link>http://www.fatbasturd.co.uk/sliding-doors-navigation-explained-demonstrated/</link>
		<comments>http://www.fatbasturd.co.uk/sliding-doors-navigation-explained-demonstrated/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 12:37:55 +0000</pubDate>
		<dc:creator>FatBasturd</dc:creator>
				<category><![CDATA[Design, CSS & Xhtml]]></category>
		<category><![CDATA[a:hover]]></category>
		<category><![CDATA[a:link]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Menu]]></category>
		<category><![CDATA[Nav]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[Sliding Doors]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.fatbasturd.co.uk/?p=88</guid>
		<description><![CDATA[
In this tutorial I am going to explain how to create a sliding door navigation menu using only CSS. When you have finished the tutorial you will finish with something like this.
you will notice that when you hover over any of the links in the example the button state changes to reflect it and it seems as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fatbasturd.co.uk/sliding-doors-navigation-explained-demonstrated"><img class="aligncenter" title="Screenshot of Menu" src="http://www.fatbasturd.co.uk/wp-content/uploads/2008/12/menu_screenshot.jpg" alt="Screenshot of Menu" /></a></p>
<p>In this tutorial I am going to explain how to create a sliding door navigation menu using only CSS. When you have finished the tutorial you will finish with something like <a title="Sliding Doors using only CSS" href="http://www.fatbasturd.co.uk/sliding_doors.html" target="_blank">this</a>.</p>
<p>you will notice that when you hover over any of the links in the example the button state changes to reflect it and it seems as if only one image is used. This is not the case!! Sliding door menus use two images , one for the left and one for the right. I am also implementing <a href="http://www.fatbasturd.co.uk/css-rollover-tabs-how-i-do-them/" target="_blank">my CSS menu trick </a>so we use only one image for the left hover and link state and likewise for the right reducing flicker and making the script lighter.</p>
<p>The source files for this tutorial are included and the menu has been tested in IE6, IE7, Firefox &amp; Safari (Windows). Onward bound&#8230; <span id="more-88"></span></p>
<h4>The images</h4>
<p>For this menu we use a total of two images for the entire effect. Amazing huh? The images are specially laid out like so:</p>
<p><img title="nav_left" src="http://www.fatbasturd.co.uk/wp-content/uploads/2008/12/nav_left.gif" alt="nav_left" width="156" height="74" />  <img title="nav_right" src="http://www.fatbasturd.co.uk/wp-content/uploads/2008/12/nav_right.gif" alt="nav_right" width="12" height="74" /></p>
<p>The way the images are laid out allows us to use longer links if we need to and the buttons will automatically expand to fit.</p>
<h4>The HTML</h4>
<p>The HTML for the menu is very simple and takes up few lines.</p>
<pre class="xhtml">&lt;div id="aqua_blue_nav"&gt;
&lt;ul&gt;
 &lt;li id="selected"&gt;&lt;a href="#"&gt;&lt;span&gt;Link 1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;&lt;span&gt;Link 2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;&lt;span&gt;Longer Link 1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;&lt;span&gt;Link 3&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;&lt;span&gt;Link 4&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href="#"&gt;&lt;span&gt;Another Long Link&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br style="clear:both" /&gt;
&lt;/div&gt; </pre>
<p>You will see that the links are contained within two HTML elements (Link &amp; Span) within the li tags. This is to allow us to call CSS functions to control them as we need to so lets break it down and actually explain what we are doing.</p>
<p><strong>Link 1:</strong> &lt;li&gt;&lt;a href=&#8221;#&#8221;&gt;&lt;span&gt;Link 2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;. You can see that link two is contained within an li tag  and within that we have a simple href tag and within that a span tag.</p>
<p>The href uses the following rule</p>
<pre class="css">#aqua_blue_nav a {
 background-image: url(aqua_blue/nav_left.gif);
 background-repeat: no-repeat;
 background-position: left bottom;
 display: inline-block;
 height: 37px;
 line-height: 37px;
 font-weight: bold;
 color: #333333;
 text-decoration: none;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 12px;
 padding-left: 12px;
}</pre>
<p>What we are doing here is declaring that any link within the navigation must use the left image in its normal state positioned to the left but the problem we have here is that the left image has no curve on the right side making the link look incomplete so we need to find a way of adding the right image into the link too. This is accomplished by calling the span tag from within the link using the following CSS.</p>
<pre class="css">#aqua_blue_nav a span {
 background-image: url(aqua_blue/nav_right.gif);
 background-repeat: no-repeat;
 background-position: right bottom;
 height: 37px;
 display: inline-block;
 padding-right: 12px;
 cursor: hand;
}</pre>
<p>Now our link has a left image and a right image associated with it and will expand to fit the text you require within the button but how do we now do the same but for the hover effect? Simple..we target the elements exactly the same as we just did but instead of simply using #aqua_blue_nav a, we will be using #aqua_blue_nav a:hover which tells the browser that the link has our mouse over it so it should change. We do this by using the following CSS.</p>
<pre class="css">#aqua_blue_nav a:hover {
 background-image: url(aqua_blue/nav_left.gif);
 background-repeat: no-repeat;
 background-position: left top;
 display: inline-block;
 height: 37px;
 line-height: 37px;
 font-weight: bold;
 color: #333333;
 text-decoration: none;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 12px;
 padding-left: 12px;
}
#aqua_blue_nav a:hover span {
 background-image: url(aqua_blue/nav_right.gif);
 background-repeat: no-repeat;
 background-position: right top;
 height: 37px;
 display: inline-block;
 padding-right: 12px;
 cursor: hand;
}</pre>
<p>You can see that the above CSS is calling the use of the exact same images as the normal state but if you check out the background-position you will see that the position has changed from bottom to top! Basically the CSS is telling the browser that when the links are hovered over the background must rise to the top giving the desired effect.</p>
<p>On my demonstration you will see that the first link already looks like it is being hovered over! We achive this by targetting the actual li tag holding the href with the CSS rule &#8220;#selected&#8221; and using the following:</p>
<pre class="css">#selected a {
 background-image: url(aqua_blue/nav_left.gif);
 background-repeat: no-repeat;
 background-position: left top;
 display: inline-block;
 height: 37px;
 line-height: 37px;
 font-weight: bold;
 color: #333333;
 text-decoration: none;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 12px;
 padding-left: 12px;
}
#selected a span {
 background-image: url(aqua_blue/nav_right.gif);
 background-repeat: no-repeat;
 background-position: right top;
 height: 37px;
 display: inline-block;
 padding-right: 12px;
 cursor: hand;
}</pre>
<p>This is telling the browser that any link with the id selected must act like its been selected to notify the user of what page they are currently viewing. Try switching the id onto another link and you will see another link take the selected state. Using this method you can design your own menus in minutes and minimum code. These menus can add a lot of sparkle to any websites navigation menu. If you have used this tutorial to build your own menu please let me know.</p>
<p>As usual, any questions please use the comments box. I have attached the source files below and you can view a demonstration <a title="Sliding Doors using only CSS" href="http://www.fatbasturd.co.uk/sliding_doors.html" target="_blank">here</a></p>
<p>Source Files: .PSD, HTML &amp; CSS &#8211; <a href="http://www.fatbasturd.co.uk/downloads/Aqua Blue CSS Sliding Doors Menu Bundle">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.fatbasturd.co.uk/sliding-doors-navigation-explained-demonstrated/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
