<?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>Lost Resort Blog &#187; horizontal menus with images</title>
	<atom:link href="http://www.lostresort.biz/blog/tag/horizontal-menus-with-images/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lostresort.biz/blog</link>
	<description>Talking about us and about web site development</description>
	<lastBuildDate>Mon, 16 Aug 2010 08:38:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to create navigational menus using only images</title>
		<link>http://www.lostresort.biz/blog/2009/10/29/how-to-create-navigational-menus-using-only-images/</link>
		<comments>http://www.lostresort.biz/blog/2009/10/29/how-to-create-navigational-menus-using-only-images/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 11:41:59 +0000</pubDate>
		<dc:creator>Cristi_N</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[horizontal menus with images]]></category>
		<category><![CDATA[menus]]></category>

		<guid isPermaLink="false">http://www.lostresort.biz/blog/?p=517</guid>
		<description><![CDATA[Pre-Requisites: We want to create a navigational menu using a fancy font-type which looks great on our website. But, we want to achieve this effect not using any JavaScript library or any flash object and we want this menu to be similar in functionality with any other menu that uses text in anchor links. Creating [...]]]></description>
			<content:encoded><![CDATA[<p><b>Pre-Requisites</b>: We want to create a navigational menu using a fancy font-type which looks great on our website. But, we want to achieve this effect not using any JavaScript library or any flash object and we want this menu to be similar in functionality with any other menu that uses text in anchor links.</p>
<h3>Creating the menu</h3>
<p>The solution I will present I find it simple and easy to implement. We will create a navigational menu using an unordered list of anchor links displayed on one line, and we use different background images for each element to create the desired effect. The HTML code will be as following:</p>
<blockquote><p>
              <code><</code>ul id="buttons"<code>></code><br />
				<code><</code>li id="home"<code>></code><code><</code>a href="#"<code>></code>Home<code><</code>/a<code>></code><code><</code>/li<code>></code><br />
				<code><</code>li id="services"<code>></code><code><</code>a href="#"<code>></code>Services<code><</code>/a<code>></code><code><</code>/li<code>></code><br />
				<code><</code>li id="about_us"<code>></code><code><</code>a href="#"<code>></code>About Us<code><</code>/a<code>></code><code><</code>/li<code>></code><br />
				<code><</code>li id="partners"<code>></code><code><</code>a href="#"<code>></code>Partners<code><</code>/a<code>></code><code><</code>/li<code>></code><br />
				<code><</code>li id="policy"<code>></code><code><</code>a href="#"<code>></code>Policy<code><</code>/a<code>></code><code><</code>/li<code>></code><br />
				<code><</code>li id="contact"><code><</code>a href="#"<code>></code>Contact<code><</code>/a<code>></code><code><</code>/li<code>></code><br />
	    <code><</code>/ul><code>></code>
</p></blockquote>
<p>Nothing complicated so far.</p>
<p>The CSS style properties that we will use are:</p>
<blockquote><p>
ul#button li{float:left;padding:0;margin:0.1em 0.1em 0 0.1em;width:110px;height:40px;text-align:center}<br />
ul#button li a{text-decoration:none;color:#ffffff;display:block;height:40px;font-size:0px;line-height:0px}<br />
#home{background:url(images/buttons_sprite.png) no-repeat 0 0}<br />
li#home a:hover{background:url(images/buttons_sprite.png) no-repeat 0 -41px}<br />
#services{background:url(images/buttons_sprite.png) no-repeat -110px 0}<br />
li#services a:hover{background:url(images/buttons_sprite.png) no-repeat -110px -41px}<br />
#about_us{background:url(images/buttons_sprite.png) no-repeat -220px 0}<br />
li#about_us a:hover{background:url(images/buttons_sprite.png) no-repeat -220px -41px}<br />
#partners{background:url(images/buttons_sprite.png) no-repeat -330px 0}<br />
li#partners a:hover{background:url(images/buttons_sprite.png) no-repeat -330px -41px}<br />
#policy{background:url(images/buttons_sprite.png) no-repeat -440px 0}<br />
li#policy a:hover{background:url(images/buttons_sprite.png) no-repeat -440px -41px}<br />
#contact{background:url(images/buttons_sprite.png) no-repeat -550px 0}<br />
li#contact a:hover{background:url(images/buttons_sprite.png) no-repeat -550px -41px}</p>
</blockquote>
<p>As you can see, we will use one image which will incorporate all the necessary images we need, 6 for each active item and another 6 for roll-over effect. In this circumstances it will be one server request (instead of having 12 for all elements) for background images. Using the <code>background-position</code> CSS style property and setting a <code>width</code> and a <code>weight</code> for each list item we can control the appearance of the list elements. Setting the <code>font-size</code><br />
to <code>0px</code> the text should not be displayed. But in Safari and Chrome if you set it to <code>0px</code> or <code>0em</code> somewhat the text is displayed, even its dimension is reduced. Adding <code>line-height</code> property and set it to <code>0px</code> will make the text disappear forever.</p>
<h3>Conclusions</h3>
<p>With this method you can have the appearance you want for your menu using only images with the help of <code>CSS</code> style properties, with the font type you want, and with the good format of the HTML page code in accordance with the <code>SEO</code> requirements.</p>
<p>Follow this link and see few examples on <a href="http://www.lostresort.biz/examples/rollover/create-menus-using-only-images.html">how to create menus using only images</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.lostresort.biz/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.lostresort.biz/blog/2009/10/29/how-to-create-navigational-menus-using-only-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.624 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-08-19 23:38:26 -->
