{"id":1596,"date":"2012-04-12T07:36:51","date_gmt":"2012-04-12T11:36:51","guid":{"rendered":"http:\/\/www.searchenginegenie.com\/web-design-blog\/?p=1596"},"modified":"2012-04-12T07:41:05","modified_gmt":"2012-04-12T11:41:05","slug":"css-navigation-menu-using-background-positioning","status":"publish","type":"post","link":"https:\/\/www.searchenginegenie.com\/web-design-blog\/css-navigation-menu-using-background-positioning\/","title":{"rendered":"CSS Navigation Menu using background positioning"},"content":{"rendered":"<link href=\"http:\/\/www.searchenginegenie.com\/web-design-blog\/wp-content\/uploads\/2012\/04\/style.css\" type=\"text\/css\" rel=\"stylesheet\" media=\"screen\">\n<ul id=\"navigation\">\n<li><a id=\"home\" href=\"#\">Home Page<\/a><\/li>\n<li><a id=\"about\" href=\"#\">About Us<\/a><\/li>\n<li><a id=\"webdesign\" href=\"#\">Web Design<\/a><\/li>\n<li><a id=\"graphicdesign\" href=\"#\">Graphic Designs<\/a><\/li>\n<li><a id=\"contact\" href=\"#\">Contact Us<\/a><\/li>\n<\/ul>\n<p><\/br><br \/>\n<\/br><br \/>\n<\/br><br \/>\n<\/br><\/p>\n<p>Step-1 Open an html document. Write the following html code inside the body tag:<\/p>\n<div style=\"background-color: #f3f3f3; border: #CCC solid 0.01em; width: 500px; padding: 8px 8px 8px 8px;\">&lt;ul id=&#8221;navigation&#8221;&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;home&#8221;&gt;Home Page&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;about&#8221;&gt;About Us&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;webdesign&#8221;&gt;Web Design&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;graphicdesign&#8221;&gt;Graphic Designs&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;seo&#8221;&gt;Search Engine Optimization SEO&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;contact&#8221; &gt;Contact Us&lt;\/a&gt;&lt;\/li&gt;<br \/>\n&lt;\/ul&gt;<\/div>\n<p><\/br><br \/>\nStep-2\u00a0 Create a new CSS document and write the following CSS syntax and save it as MAIN.CSS.Here background position defined to draw the different position of the button into visible.<\/p>\n<div style=\"background-color: #f3f3f3; border: #CCC solid 0.01em; width: 500px; padding: 8px 8px 8px 8px;\">#navigation { list-style: none; margin: 0; padding: 0;}<br \/>\n#navigation:hover li a#webdesign { background-position: -280px; }<br \/>\n#navigation:hover li a#home { background-position: -206px; }<br \/>\n#navigation:hover li a#graphicdesign { background-position: -340px; }<br \/>\n#navigation:hover li a#contact { background-position: -232px; }<br \/>\n#navigation:hover li a#about { background-position: -242px; }<br \/>\n#navigation:hover li a#seo { background-position: -540px; }<br \/>\n#navigation li { float: left; }<br \/>\n#navigation li a { text-indent: -999999px; overflow: hidden; display: block; height: 72px; }<br \/>\n#home { background: url(home.gif); width: 103px; }<br \/>\n#home:hover { background: url(home.gif) 0 0 !important; }<br \/>\n#about { background: url(about.gif); width: 121px; }<br \/>\n#about:hover { background: url(about.gif) 0 0 !important; }<br \/>\n#webdesign { background: url(webdesign.gif); width: 140px; }<br \/>\n#webdesign:hover { background: url(webdesign.gif) 0 0 !important; }<br \/>\n#graphicdesign { background: url(graphicdesign.gif); width: 170px; }<br \/>\n#graphicdesign:hover { background: url(graphicdesign.gif) 0 0 !important; }<br \/>\n#seo { background: url(seo.gif); width: 281px; }<br \/>\n#seo:hover { background: url(seo.gif) 0 0 !important; }<br \/>\n#contact { background: url(contact.gif); width: 116px; }<br \/>\n#contact:hover { background: url(contact.gif) 0 0 !important; }<\/div>\n<p><\/br><br \/>\nStep-3 Paste the following code inside the &lt;head&gt;&lt;\/head&gt; tag in HTML file to link the MAIN.CSS.<\/p>\n<div style=\"background-color: #f3f3f3; border: #CCC solid 0.01em; width: 500px; padding: 8px 8px 8px 8px;\">&lt;link href=&#8221;web-design3_files\/main2.css&#8221; type=&#8221;text\/css&#8221; rel=&#8221;stylesheet&#8221; media=&#8221;screen&#8221;&gt;<\/div>\n<p><\/br><br \/>\nStep-4 Your HTML, CSS and below images should be in same folder.<\/p>\n<p><a name=\"imageclose-1597\"><div class=\"lb-album\"><a href=\"#image-1597\"><img src=\"http:\/\/www.searchenginegenie.com\/web-design-blog\/wp-content\/uploads\/2012\/04\/home.gif\"  class=\"size-full wp-image-1642 aligncenter\"><span><\/span><\/a><\/div>              \r\n<a href=\"#imageclose-1597\" class=\"css3lightbox-close\">\r\n\t\t\t\t   <div class=\"lb-overlay\" id=\"image-1597\">\r\n                   <img src=\"http:\/\/www.searchenginegenie.com\/web-design-blog\/wp-content\/uploads\/2012\/04\/home.gif\" alt=\"image-1597\">\r\n                   <\/div><\/a><\/p>\n<p>Now run the program.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Home Page About Us Web Design Graphic Designs Contact Us Step-1 Open an html document. Write the following html code inside the body tag: &lt;ul id=&#8221;navigation&#8221;&gt; &lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;home&#8221;&gt;Home Page&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;about&#8221;&gt;About Us&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;webdesign&#8221;&gt;Web Design&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;graphicdesign&#8221;&gt;Graphic Designs&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;seo&#8221;&gt;Search Engine Optimization SEO&lt;\/a&gt;&lt;\/li&gt; &lt;li&gt;&lt;a href=&#8221;#&#8221; id=&#8221;contact&#8221; &gt;Contact Us&lt;\/a&gt;&lt;\/li&gt; &lt;\/ul&gt; Step-2\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90,6,5],"tags":[135,134,137,136],"class_list":["post-1596","post","type-post","status-publish","format-standard","hentry","category-html","category-web-design","category-web-design-tips","tag-css-background-positioning","tag-css-navigation-menu","tag-html-navigation-menu","tag-x-advanced-background-positioning-css"],"_links":{"self":[{"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/posts\/1596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/comments?post=1596"}],"version-history":[{"count":42,"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/posts\/1596\/revisions"}],"predecessor-version":[{"id":1655,"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/posts\/1596\/revisions\/1655"}],"wp:attachment":[{"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/media?parent=1596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/categories?post=1596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.searchenginegenie.com\/web-design-blog\/wp-json\/wp\/v2\/tags?post=1596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}