www.webdeveloper.com
Results 1 to 2 of 2

Thread: HTML drop downs not working

  1. #1
    Join Date
    Sep 2011
    Posts
    1

    HTML drop downs not working

    Hi

    I am not able to get the drop downs working when i place this code in my application .i have given below m css file and the Html page .When i deploy the css file and html page along witht the csshover3.htc i am able to get the drop downs working properly (horizontally) in ie7 ,firefox. but when i integrate this code in my application i am not able to get the dropdown instead i get the menu in the left of the page vertical .Presently i am using ie7 but i want it to be browser compatible so i am using only html here. Please verify the code below

    CSS

    Code:
    #menu {
    width: 100%;
    background: #eee;
    float: left;
    }
    
    #menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    float: left;
    }
    
    #small {width: 3em;}
    #medium {width: 5em;}
    #large {width: 8em;}
    
    
    #menu a, #menu h2 {
    font: bold 10px Verdana, Arial, Helvetica, sans-serif;
    display: block;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc #888 #555 #bbb;
    margin: 0;
    padding: 2px 3px;
    }
    
    
    #menu li {position: relative;}
    
    #menu ul ul {
    position: absolute;
    z-index: 500;
    width: 9em;
    }
    
    #menu ul ul ul {
    top: 0;
    left: 100%;
    }
    
    
    div#menu ul ul,
    div#menu ul li:hover ul ul,
    div#menu ul ul li:hover ul ul
    {display: none;}
    
    div#menu ul li:hover ul,
    div#menu ul ul li:hover ul,
    div#menu ul ul ul li:hover ul
    {display: block;}
    
    #menu h2 {
    color: #ddbc36;
    background: #003366;
    text-transform: uppercase;
    }
    
    #menu a {
    color: #000;
    background: #efefef;
    text-decoration: none;
    }
    
    #menu a:hover {
    color: #a00;
    background: #fff;
    }

    HTML


    Code:
    <html>
    <head>
    <LINK href="/css/menu.css" rel="stylesheet" type="text/css">
    <!--[if IE]>
    <style type="text/css" media="screen">
    body {
    behavior: url(css/csshover3.htc);  
    font-size: 100%;
    }
    
    #menu ul li {float: left; width: 100%;}
    #menu ul li a {height: 1%;} 
    
    #menu a, #menu h2 {
    font: bold 0.7em/1.4em arial, helvetica, sans-serif;
    }
    </style>
    <![endif]-->
    </head>
    <body>
    <div id="menu"> 
    
    <ul id="small">
      <li><h2>T</h2>
           <ul>
              <li><a href="../action/T1 ">A1</a></li>
    	  <li><a href="../action/T2=true">A2</a></li>
    	  <li><a href="../action/T3=true">A3</a></li>
    	  <li><a href="../action/T4=InitialPage">A4</a></li>
    	  <li><a  href="../action/T5=InitialPage">A5</a></li>
    	
    	  <li><a href="#S">B</a>
    		<ul>
    		    <li><a href="../action/S1">B1</a></li>
    		    <li><a href="../action/S2">B2</a></li>
    		    <li><a href="../action/S3">B3</a></li>
    		    <li><a href="../action/S4">B4</a></li>
    		    <li><a href="#S">B5        </a>
    				<ul>
    					<li><a href="../action/Messages?listType=CREATE">Create</a></li>
    					<li><a href="../action/Messages?listType=VIEW">View</a></li>
    				</ul>
    		    </li>
    				
    		</ul>
    	  </li>
    
           </ul>
      </li>
    </ul>
    <ul id="medium">
      <li><h2>V</h2>
           <ul>
              <li><a href="../action/V1">C1</a></li>
    	  <li><a href="../action/V2">C2</a></li>
    	  <li><a href="../action/V3">C3</a></li>
    	  <li><a href="#U">C4</a></li>
    	  <li><a  href="../action/U1">D1</a></li>
    	  <li><a  href="../action/U2">D2</a></li>
    	  <li><a href="../action/U3">D3</a></li>
           </ul>
      </li>
    </ul>
    <ul id="medium">
      <li><h2>X</h2>
           <ul>
    				<li><a href="../action/X1">E1</a></li>
    				<li><a href="../action/X2">E2</a></li>
    				<li><a href="../action/X3">E3</a></li>
           </ul>
      </li>
    </ul>
    <ul id="medium">
      <li><h2>ALL OTHER</h2>
           <ul>
    				<li><a href="../action/Y1">F1</a></li>
    				<li><a href="../action/Y2">F2</a></li>
    				      
           </ul>
      </li>
    </ul>
    <ul id="small">
      <li><a href="../action/Z" style="color:#ddbc36;background:#003366;text-transform: uppercase;">G</a></li>
    </ul>
    <ul id="medium">
      <li><h2>V</h2>
           <ul>
    				<li><a href="../action/V1">H1</a></li>
    				<li><a href="../action/V2">H2</a></li>
          </ul>
      </li>
    </ul>
    <ul id="large">
      <li><h2>W</h2>
           <ul>
    				<li><a href="../action/W1">I1</a></li>
    				<li><a href="../action/W2">I2</a></li>
    				<li><a href="../action/W3">I3</a></li>
    				<li><a href="../action/W4">I4</a></li>
    				<li><a href="../action/W5">I5</a></li>
    				<li><a href="../action/W6">I6</a></li>				
    				<li>
    					<a  href="../action/Z">J</a>
    					<ul>
    							<li><a  href="../action/Z1">J1</a></li>
    							<li><a  href="../action/Z2">J2</a></li>
    							<li><a  href="../action/Z3">J3</a></li>
    					</ul>
    				</li>	
           </ul>
      </li>
    </ul>
    <ul id="medium">
      <li><h2>Q</h2>
           <ul>
    				<li><a href="../action/Q1">K1</a></li>
    				<li><a href="../action/Q2">K2</a></li>
           </ul>
      </li>
    </ul>
    <ul id="large">
      <li><h2>P</h2>
           <ul>
    				<li><a href="../action/P1">L1</a></li>
    				<li><a href="../action/P2">L2</a></li>				
           </ul>
      </li>
    </ul>
    <ul id="small">
      <li><a href="#" style="color:#ddbc36;background:#003366;text-transform: uppercase;" onclick='return showTopMenuHelp()'>Help</a></li>
    </ul>
    							
    </div> 
    </body>
    </html>

  2. #2
    Join Date
    Sep 2011
    Location
    India
    Posts
    21
    Hi Sandeep,

    I checked the above code, on firefox and chromes , its working fine, but doesn't work in IE.

    I think the reason is because you are uisng duplicate id (small,large,medium) , which IE is unable to parse. Try changing the Id, and check once.


    Thanks
    Mourya

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles