LJackson
08-15-2010, 09:24 AM
Hi All,
Ihave been following a tutorial to create a menu but with one difference,in the tutorial they have an image for each button and each image consists of 3 individual images for the different states of the button(default, hover, active) and i have just the one image with all the individual images in this image.
the idea is to display certain parts of the image to show the correct individual images but for some reason i cant seem to get the default images to appear, hover works.
here is my page code
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#main_nav { list-style: none; margin: 0; padding: 0; }
#main_nav li { float: left; }
#main_nav li a { text-indent: -999999px; overflow: hidden; display: block; height: 72px; }
#home { background:url(menuIMG.png); width: 103px; }
#home:hover { background: url(menuIMG.png) 0 0 !important; }
#home.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#home { background-position: -232px; }
#about { background:url(menuIMG.png); width: 103px; }
#about:hover { background: url(menuIMG.png) -464px 0 !important; }
#about.active { background: url(menuIMG.png) -464px 0; }
#main_nav:hover li a#about { background-position: -580px; }
#webdesign { background:url(menuIMG.png); width: 103px; }
#webdesign:hover { background: url(menuIMG.png) -825px 0 !important; }
#webdesign.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#webdesign { background-position: -941px; }
#graphicdesign { background:url(menuIMG.png); width: 103px; }
#graphicdesign:hover { background: url(menuIMG.png) -812px 0 !important; }
#graphicdesign.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#graphicdesign { background-position: -928px; }
#seo { background:url(menuIMG.png); width: 145px; }
#seo:hover { background: url(menuIMG.png) -1046px 0 !important; }
#seo.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#seo { background-position: -1339px; }
#contact { background:url(menuIMG.png); width: 103px; }
#contact:hover { background: url(menuIMG.png) -1443px 0 !important; }
#contact.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#contact { background-position: -1443px; }
#books { background:url(menuIMG.png); width: 103px; }
#books:hover { background: url(menuIMG.png) 0 0 !important; }
#books.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#books { background-position: -232px; }
</style>
</head>
<body>
<ul id="main_nav">
<li><a href="index.html" accesskey="3" id="home" title="Home Page">Home Page</a></li>
<li><a href="about-us.html" accesskey="4" id="about" title="About 3.7 Designs">About Us</a></li>
<li><a href="graphic-design.html" accesskey="6" title="Graphic Design and Marketing" id="graphicdesign">Graphic Designs</a></li>
<li><a href="keyword-optimization/michigan-seo.html" accesskey="7" title="Search Engine Optimization and Marketing" id="seo">Search Engine Optimization SEO</a></li>
<li><a href="ann-arbor-marketing.html" accesskey="8" id="contact" title="Contact Us">Contact Us</a></li>
</ul>
</body>
</html>
and here is a link to my image
http://www.kernow-connect.com/images/menuIMG.png
here is my test page
http://www.kernow-connect.com/menu_test2.php
anyone able to help to get this working correctly?
many thanks
Luke
Ihave been following a tutorial to create a menu but with one difference,in the tutorial they have an image for each button and each image consists of 3 individual images for the different states of the button(default, hover, active) and i have just the one image with all the individual images in this image.
the idea is to display certain parts of the image to show the correct individual images but for some reason i cant seem to get the default images to appear, hover works.
here is my page code
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
#main_nav { list-style: none; margin: 0; padding: 0; }
#main_nav li { float: left; }
#main_nav li a { text-indent: -999999px; overflow: hidden; display: block; height: 72px; }
#home { background:url(menuIMG.png); width: 103px; }
#home:hover { background: url(menuIMG.png) 0 0 !important; }
#home.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#home { background-position: -232px; }
#about { background:url(menuIMG.png); width: 103px; }
#about:hover { background: url(menuIMG.png) -464px 0 !important; }
#about.active { background: url(menuIMG.png) -464px 0; }
#main_nav:hover li a#about { background-position: -580px; }
#webdesign { background:url(menuIMG.png); width: 103px; }
#webdesign:hover { background: url(menuIMG.png) -825px 0 !important; }
#webdesign.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#webdesign { background-position: -941px; }
#graphicdesign { background:url(menuIMG.png); width: 103px; }
#graphicdesign:hover { background: url(menuIMG.png) -812px 0 !important; }
#graphicdesign.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#graphicdesign { background-position: -928px; }
#seo { background:url(menuIMG.png); width: 145px; }
#seo:hover { background: url(menuIMG.png) -1046px 0 !important; }
#seo.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#seo { background-position: -1339px; }
#contact { background:url(menuIMG.png); width: 103px; }
#contact:hover { background: url(menuIMG.png) -1443px 0 !important; }
#contact.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#contact { background-position: -1443px; }
#books { background:url(menuIMG.png); width: 103px; }
#books:hover { background: url(menuIMG.png) 0 0 !important; }
#books.active { background: url(menuIMG.png) -103px 0; }
#main_nav:hover li a#books { background-position: -232px; }
</style>
</head>
<body>
<ul id="main_nav">
<li><a href="index.html" accesskey="3" id="home" title="Home Page">Home Page</a></li>
<li><a href="about-us.html" accesskey="4" id="about" title="About 3.7 Designs">About Us</a></li>
<li><a href="graphic-design.html" accesskey="6" title="Graphic Design and Marketing" id="graphicdesign">Graphic Designs</a></li>
<li><a href="keyword-optimization/michigan-seo.html" accesskey="7" title="Search Engine Optimization and Marketing" id="seo">Search Engine Optimization SEO</a></li>
<li><a href="ann-arbor-marketing.html" accesskey="8" id="contact" title="Contact Us">Contact Us</a></li>
</ul>
</body>
</html>
and here is a link to my image
http://www.kernow-connect.com/images/menuIMG.png
here is my test page
http://www.kernow-connect.com/menu_test2.php
anyone able to help to get this working correctly?
many thanks
Luke