<?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>Sunils blog &#187; Un ordered list</title>
	<atom:link href="http://www.myhtmlworld.com/tag/un-ordered-list/feed" rel="self" type="application/rss+xml" />
	<link>http://www.myhtmlworld.com</link>
	<description>myhtmlworld.com</description>
	<lastBuildDate>Mon, 14 Nov 2011 09:27:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to create a simple navigation using CSS and XHTML</title>
		<link>http://www.myhtmlworld.com/web-development/how-to-create-a-simple-navigation-using-css-and-xhtml.html</link>
		<comments>http://www.myhtmlworld.com/web-development/how-to-create-a-simple-navigation-using-css-and-xhtml.html#comments</comments>
		<pubDate>Sun, 12 Apr 2009 05:11:11 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Horizontal navigation]]></category>
		<category><![CDATA[Un ordered list]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://www.myhtmlworld.com/?p=248</guid>
		<description><![CDATA[When I wrote about the Unobstructive image gallery listing using CSS, many people asked me to post some tutorial on this blog. So that will be helpful for others. So I decided to create some tutorials on this blog. This is the first step for that. Here I am trying to make simple navigation, which [...]]]></description>
			<content:encoded><![CDATA[<p>When I wrote about the <a href="http://www.myhtmlworld.com/web-development/image-gallery-listing-using-css.html">Unobstructive image gallery listing using CSS</a>, many people asked me to post some tutorial on this blog. So that will be helpful for others. So I decided to create some tutorials on this blog. This is the first step for that.</p>
<p>Here I am trying to make simple navigation, which uses the html tag unordered list (ul li). It would be nice if we are using unordered lists for navigation menus. We can easily manage the navigation though <a href="http://en.wikipedia.org/wiki/Document_Object_Model">DOM</a> and it may help a little bit on SEO (Search Engine Optimisation).</p>
<p>Before creating this navigation, I am expecting that you may have some simple idea about HTML and CSS. </p>
<p>First, we have to create one simple html like the following on your favorite html or text editor. I am using <a href="http://intype.info/home/index.php">intype</a> editor for creating the document and I personally like to code it by hand. I am not using any other user interface software for creating the html elements.</p>
<p>So the html code will be like the following</p>
<pre lang="HTML" line="1"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<link rel="stylesheet" href="style.css" type="text/css"  />

</head>
<body>
<ul class="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Site map</a></li>
</ul>

</body>
</html></pre>
<p> <br />
So, our html is ready!</p>
<p>Next, we need to create the CSS.</p>
<p>Since we are not creating any other pages, I am only covering the styles required for the current page. Before that, we need to add the style sheet path to the document like this inside the head tag.</p>
<pre lang="CSS" >
<link rel="stylesheet" href="style.css" type="text/css"  /></pre>
<p>Now I am creating the style sheet required for the page</p>
<p>I wrote the following code on the style sheet style.css file</p>
<pre lang="CSS" line="1">
body{
margin:0;
padding:0;
font-family:verdana, arial;
font-size:12px;
}
ul.nav{
margin:0;
padding:0;
list-style:none;
}

ul.nav li a{
text-decoration:none;
}
</pre>
<p>Now the vertical navigation is ready. You can add color for the anchor tag as you wishes like this</p>
<pre lang="CSS" >
ul.nav li a{
text-decoration:none;
color:red;
}
</pre>
<p>If you want to add some color on the mouse over, you simply need to add the color for the element</p>
<pre lang="CSS" >
ul.nav li a:hover{
color:green;
}
</pre>
<p>So the mouse over is also ready. You need to add proper padding, margin to the ul li tags, and then it will look nice.</p>
<p>Now I am changing this to horizontal navigation. For that we need to float the li selector. So it will looks like this</p>
<pre lang="CSS" >
ul.nav li{
float:left;
padding-right:15px;
}
</pre>
<p> <br />
Padding-right used for the space required after the each menu. So the basic menu is ready.</p>
<p><a target="_blank" href='http://www.myhtmlworld.com/wp-content/uploads/2009/04/navigation-demo.zip'>Download sample file</a> Less than 1 KB.</p>
<p>This is the very basic navigation style that can be creating with XHTML CSS. We can enrich the menu by adding background colors, background images or roll over effects. That all things I will explain another time.</p>
<p>Hope this tutorial will be interesting to you. If you have any doubt, suggestions or questions please post comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.myhtmlworld.com/web-development/how-to-create-a-simple-navigation-using-css-and-xhtml.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

