Why does CSS menu not work in IE?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shanku vatsal
    New Member
    • Jan 2011
    • 3

    Why does CSS menu not work in IE?

    This is my HTML file
    Code:
    <html>
    <head>
    
    <style type="text/css">
    @import url(menu.css);
    </style>
    <!--[if IE]>
    
    
    <![endif]-->
    </head>
    <body>
    <!-- start menu HTML -->
    <div id="menu">
    <ul>
      <li><h2>HOME</h2>
      </li>
    </ul>
    
    <ul>
      <li><h2>ABOUT US</h2>
        <ul>
          <li><a href="#" title="">MISSION</a> </li>
          <li><a href="#" title="">VISION</a></li>
          <li><a href="#" title="">IDEOLOGY</a></li>
          <li><a href="#" title="">HISTORY</a> </li>
          <li><a href="#" title="">ADMINISTRATION</a></li>
            
         
        </ul>
      </li>
    </ul>
    
    <ul>
    
      <li><h2>COURSE OFFERED </h2>
        <ul>
          <li><a href="#" title="">GRADUATE</a></li>
          		 <ul>
    
                  <li><a href="#" title="">BCOM</a></li>
                  <li><a href="#" title="">BSC</a></li>		
                  <li><a href="#" title="">BCA</a></li>
                 </ul>
                 
          <li><a href="#" title="">POST GRADUATE</a>
            <ul>
              <li><a href="#" title="Vertical Menu Tutorial">tanfa Tutorial</a>	
                <ul>
    
                  <li><a href="#" title="">MCA</a></li>
                  <li><a href="#" title="">MBA</a></li>		
                  <li><a href="#" title="">MCOM</a></li>
                  <li><a href="#" title="">MMS</a></li>
                  
                </ul>
    
              </li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>
    
    <ul>
      <li><h2>LIFE ON CAMPUS</h2>
    
        <ul>
          <li><a href="#" title="" </a>EXTRA CURCULUM</li>
          <li><a href="#">INNOVATION</a></li>
    	<li><a href="#">STUDENT FORUM</a></li>	
        <li><a href="#">COMPUS DISCRIPTION</a></li>  
        
        </ul>
      </li>
    </ul>
    						
    </div>
    </body>
    <html>


    This is my CSS File
    Code:
    #menu {
    width: 100%;
    background: #eee;
    float: left;
    }
    
    #menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 12em;
    float: left;
    }
    
    #menu a, #menu h2 {
    font: bold 11px/16px arial, helvetica, sans-serif;
    display: block;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc #888 #555 #bbb;
    margin: 0;
    padding: 2px 3px;
    }
    
    #menu h2 {
    color: #fff;
    background: #000;
    text-transform: uppercase;
    }
    
    #menu a {
    color: #000;
    background: #efefef;
    text-decoration: none;
    }
    
    #menu a:hover {
    color: #a00;
    background: #fff;
    }
    
    #menu li {position: relative;}
    
    #menu ul ul {
    position: absolute;
    z-index: 500;
    }
    
    #menu ul ul ul {
    position: absolute;
    top: 0;
    left: 100%;
    }
    
    div#menu ul ul {
    display: none;
    }
    
    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;}
    this working properly in other browser bt nt in IE.. what is the problem and hw can i fix it...
    Last edited by Niheel; Jan 22 '11, 05:42 PM. Reason: please use [CODE] [/CODE] tags when posting code
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Without a doctype, you will never get IE to attempt to perform like the other far more modern browsers. Add this to your first line: <!doctype html>

    Comment

    • shanku vatsal
      New Member
      • Jan 2011
      • 3

      #3
      tried no change. thanks 4 d reply

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        This works in IE for me. Specifically what do you see that doesn't work?

        Comment

        • shanku vatsal
          New Member
          • Jan 2011
          • 3

          #5
          the effects that i hav give to the menu.. its not popping out. Just the root item are been displayed but the when my mouse is over those element the sub-menu are not been displayed.

          Comment

          Working...