<?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>Web Design, Wordpress, CSS - Tips and Tricks</title>
	<atom:link href="http://www.josemon.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.josemon.com</link>
	<description>Tips and Tricks</description>
	<lastBuildDate>Mon, 12 Mar 2012 11:48:55 +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>Create a CSS dropdown menu without javascript</title>
		<link>http://www.josemon.com/create-a-css-dropdown-menu-without-javascript/</link>
		<comments>http://www.josemon.com/create-a-css-dropdown-menu-without-javascript/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 11:13:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Tricks]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[pure css dropdown]]></category>

		<guid isPermaLink="false">http://www.josemon.com/?p=4</guid>
		<description><![CDATA[The dropdown menus makes the layouts clean and it helps the visitors to navigate easily. Most of the people use javascripts to create dropdown menus. It is easy to create dropdown using CSS. Here is a beautiful CSS dropdown menu without javascript. Code for a typical Dropdown Menu:&#60;div id=&#34;menu&#34;&#62; &#60;ul&#62; &#60;li&#62;&#60;a href=&#34;/&#34;&#62;Home&#60;/a&#62;&#60;/li&#62; &#60;li&#62;&#60;a href=&#34;/&#34;&#62;About&#60;/a&#62;&#60;/li&#62; &#60;li&#62;&#60;a [...]]]></description>
			<content:encoded><![CDATA[<p>The dropdown menus makes the layouts clean and it helps the visitors to navigate easily. Most of the people use javascripts to create dropdown menus. It is easy to create dropdown using CSS. Here is a beautiful CSS dropdown menu without javascript.</p>
<p>Code for a typical Dropdown Menu:</p><pre class="crayon-plain-tag"><code>&lt;div id=&quot;menu&quot;&gt;
&lt;ul&gt;

	&lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/&quot;&gt;Services&lt;/a&gt;
	    &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Web Design&lt;/a&gt;&lt;/li&gt;
	    &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Web Hosting&lt;/a&gt;&lt;/li&gt;
	    &lt;li&gt;&lt;a href=&quot;/&quot;&gt;Marketing&lt;/a&gt;&lt;/li&gt;
	    &lt;li&gt;&lt;a href=&quot;/&quot;&gt;SEO&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;
	&lt;li&gt;&lt;a href=&quot;/&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;</code></pre>
<p>Let us style the menu:</p><pre class="crayon-plain-tag"><code>#menu ul{list-style:none;margin:0; padding:0;}

#menu li{float:left;margin:0; padding:0;position:relative:}

#menu li a{float:left;margin:0; padding:10px 20px; background:#ececec; color:#333;font-size:12px;border-right:1px solid #ccc;}</code></pre><p><p>
First we will hide the child items -</p><pre class="crayon-plain-tag"><code>#menu ul ul{display:none;}</code></pre><p><p><p>
Now the most important part &#8211; Child items should display on mouse hover on parent items:</p><pre class="crayon-plain-tag"><code>#menu ul li:hover &gt; ul{display:block; }</code></pre><p><p><p><p>
Now we will add absolute position for child ul:</p><pre class="crayon-plain-tag"><code>#menu ul ul{position:absolute;top:20px; left:0px;}</code></pre><p><p><p><p><p>
Now add borders, background images etc for the dropdown items. You can use the same way to display third and fourth levels of the dropdown. This CSS menu is suitable to display wordpress pages and categories as dropdown.</p><pre class="crayon-plain-tag"><code>#menu li a{float:left;margin:0; padding:0px 10px; background:#ececec; color:#333;line-height:20px; font-size:12px;}</code></pre><p></p>
<p>Complete CSS code:</p>
<pre class="crayon-plain-tag"><code>#menu{width:980px; margin:0px auto; background:#ececec; border-left:1px solid #ccc;}
#menu ul{list-style:none;margin:0; padding:0;}

#menu li{float:left;margin:0; padding:0;position:relative:}

#menu li a{float:left;margin:0; padding:10px 20px; background:#ececec; color:#333;font-size:12px;border-right:1px solid #ccc;}
#menu ul ul{display:none;}
#menu ul li:hover &gt; ul{display:block; }
#menu ul ul{position:absolute;top:20px; left:0px;}
#menu ul ul li{width:200px;}
#menu ul ul li a{float:left;margin:0; padding:0px 10px; background:#ececec; color:#333;line-height:20px; font-size:12px;border:1px solid #ccc;}</code></pre><p><p><p><p><p><p>
<p>You can use the same CSS code to create a category dropdown menu, page dropdown menu or a custom menu in wordpress.</p>
<p>To display a &#8216;page&#8217; dropdown menu:</p><pre class="crayon-plain-tag"><code>&lt;div id=&quot;menu&quot;&gt;
&lt;ul&gt;
&lt;?php wp_list_pages('title_li=' ); ?&gt;
&lt;/ul&gt;
&lt;/div&gt;</code></pre><p><p><p><p><p><p><p>
<p>Categories:</p>
<pre class="crayon-plain-tag"><code>&lt;div id=&quot;menu&quot;&gt;
&lt;ul&gt;
&lt;?php wp_list_categories('title_li=' ); ?&gt;
&lt;/ul&gt;
&lt;/div&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.josemon.com/create-a-css-dropdown-menu-without-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

