Results 1 to 9 of 9

Thread: CSS: Code working in Mozilla/Opera but not in IE

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    CSS: Code working in Mozilla/Opera but not in IE

    Previously posted about the reverse but took some advice and developed for the othertype of browsers. Now in IE my code doesn't look so hot.

    I am trying to create a menu bar with a list dropdown. Not too sure where IE is reading this wrong.

    Testing Page:
    http://www.cyclonicvacuum.com/dhtml/sitemap.html

    Main code
    Code:
    <ul id="nav">
      <li><a href="http://www.cyclonicvacuum.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('home','','../images/buttons/homeOver.gif',1)"><img src="../images/buttons/home.gif" name="home" width="35" height="20" border="0"></a></li>
    
      <li><a href="http://www.cyclonicvacuum.com/dysonstory.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('dysonStory','','../images/buttons/dysonstoryOver.gif',1)"><img src="../images/buttons/dysonstory.gif" name="dysonStory" width="38" height="20" border="0"></a> </li>
      <li class="rootcyclone"><a href="http://www.cyclonicvacuum.com/rootcyclone.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('rootcyclone','','../images/buttons/rootcycloneOver.gif',1)"><img src="../images/buttons/rootcyclone.gif" name="rootcyclone" width="86" height="20" border="0"></a></li>
      <li><a href="http://www.cyclonicvacuum.com/dysonvacuum.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('products','','../images/buttons/productsOver.gif',1)"><img src="../images/buttons/products1.gif" name="products" width="55" height="20" border="0"></a> 
                <ul>
                  <li><a href="/dc07-all-floors.html">Dyson DC07 All Floors</a></li>
                  <li><a href="/dc07-all-floors-refurbished.html">Dyson DC07 - Factory 
                    Reconditioned</a></li>
                  <li><a href="/dc07-low-reach.html">Dyson DC07 Low Reach</a></li>
                  <li><a href="/dc07-low-reach-refurbished.html">Dyson DC07 Low Reach 
                    - Factory Reconditioned</a></li>
                  <li><a href="/dc07-full-kit.html">Dyson DC07 Full Kit</a></li>
                  <li><a href="/dc07-animal.html">Dyson DC07 Animal</a></li>
                  <li><a href="/dc07-animal-refurbished.html">Dyson DC07 Animal - 
                    Factory Reconditioned</a></li>
                  <li><a href="/dc07-full-gear.html">Dyson DC07 Full Gear</a></li>
                  <li><a href="/dc11-all-floors.html">Dyson DC11 All Floors</a></li>
                  <li><a href="/dc11-full-gear.html">Dyson DC11 Full Gear</a></li>
                  <li><a href="/dc14-low-reach.html">Dyson DC14 Low Reach</a></li>
                  <li><a href="/dc14-animal.html">Dyson DC14 Animal</a></li>
                  <li><a href="/dc14-full-gear.html">Dyson DC14 Full Gear</a></li>
                </ul>
      </li>
      <li class="ourcompany"><a href="http://www.cyclonicvacuum.com/company.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('company','','../images/buttons/ourcompanyOver.gif',1)"><img src="../images/buttons/ourcompany.gif" name="company" width="87" height="20" border="0"></a></li>
      <li><a href="http://www.cyclonicvacuum.com/contact.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contact','','../images/buttons/contactOver.gif',1)"><img src="../images/buttons/contact.gif" name="contact" width="48" height="20" border="0"></a></li>
      <li class="policy"><a href="http://www.cyclonicvacuum.com/policy.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('policy','','../images/buttons/policyOver.gif',1)"><img src="../images/buttons/policy.gif" name="policy" width="39" height="20" border="0"></a></li>
      <li><a href="http://www.cyclonicvacuum.com/warranty.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('warranty','','../images/buttons/warrantyOver.gif',1)"><img src="../images/buttons/warranty.gif" name="warranty" width="58" height="20" border="0"></a></li>
    </ul>
    Code:
    a:link { text-decoration:none}
    a:visited { text-decoration:none}
    
    body {
    	font-family: arial, helvetica, serif;
    }
    
    #nav, #nav ul { /* all lists */
    	padding: 0;
    	margin: 0;
    	list-style: none;
    	line-height: 1;
    	background: #fff; /* IE6 Bug */
    }
    
    #nav a {
    	display: block; /* The element will be displayed as a a block-level element */
    	width: 26em; /* makes the text bigger in submenu*/
    	font-family: Verdana, Arial, Helvetica, sans-serif;
    	font-size: 11px;
    	color: #999999;
    	text-indent: 5px;
    }
    
    #nav a.titles {
    	display: block;
    	width: 1em;
    }
    
    #nav a.title_oc {
    	display: block;
    	width: 8em;
    }
    
    #nav li { /* all list items */
    	float: left;
    	width: 4em; /* width needed or else Opera goes nuts */
    	/* border-bottom: 1px solid #ccc; */
    	display: block;
    }
    
    #nav li.rootcyclone { /* rootcyclone list item */
    	float: left;
    	width: 6em; /* width needed or else Opera goes nuts */
    	display: block;
    }
    
    #nav li.ourcompany { /* outcompany list items */
    	float: left; 
    	width: 6em; /* width needed or else Opera goes nuts */
    	display: block;
    }
    
    #nav li.policy { /* outcompany list items */
    	float: left; 
    	width: 3em; /* width needed or else Opera goes nuts */
    	display: block;
    }
    
    #nav li ul { /* second-level lists - aka drop down list */
    	display: block;
    	text-decoration: none;
    	color: #777;
    	background: #fff; /* IE6 Bug */
    	border: 1px solid #ccc;
    	/* border-bottom: 0; */
    	/*border-bottom: 1px solid #ccc;  put in li ul li instead */
    	position: absolute;
    	width: 18em; /* makes the box bigger but not the actual text */
    	left: -999em; /* using left instead of display to hide menus because display: none isn't read by screen readers */
    	line-height: 18px;
    }
    
    ul li a:hover { color: #E2144A; } /* Hover Styles - top menu only */
    li ul a:hover { color: #E2144A; background: #f9f9f9; } /* Hover Styles - drop down list */
    
    #nav li:hover ul, #nav li.sfhover ul { /* lists nested under hovered list items */
    	left: auto;
    }
    
    #nav li ul li { /* solved the dropdown from piling up on each other.*/
    	float: none;
    	border-bottom: 1px solid #ccc;
    	width: 18em;
    }
    
    #content {
    	clear: left;
    	color: #ccc;
    }
    Is it possible I get an error because I am using two .css files?
    Thanks in advance for your help.

  2. #2
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: CSS: Code working in Mozilla/Opera but not in IE

    Fist of all you should have a doc type in the top of your (X)HTML file so the browser knows how it should read it. Then after that do a validiation of the (X)HTML file and CSS file here:

    http://www.w3schools.com/site/site_validate.asp


    then see if some of the problems is gone.



    ØØ



    [Edit] I realy like the design of your page. Realy nice.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: CSS: Code working in Mozilla/Opera but not in IE

    I added:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Translational//EN">
    to the top of the page but made it look like crap.

    How do you know when to use a certain one. I just want the simpliest one available? Any clue?

    Thanks for your time.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: CSS: Code working in Mozilla/Opera but not in IE

    This bit bothers me: display: block; ......
    Wondering if it should be inline instead of block....

    Tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: CSS: Code working in Mozilla/Opera but not in IE

    Quote Originally Posted by techgnome
    This bit bothers me: display: block; ......
    Wondering if it should be inline instead of block....

    Tg

    I have no idea (since I am no web programmer) what inline or block mean. But display:block is supposed to go in the CSS file (if that answered the Q)

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: CSS: Code working in Mozilla/Opera but not in IE

    Quote Originally Posted by lleemon
    I added:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Translational//EN">
    to the top of the page but made it look like crap.

    How do you know when to use a certain one. I just want the simpliest one available? Any clue?

    Thanks for your time.

    XHTML is the new one. On the link I gave you, you can read more about the diffrences. But it looks too me that this is the right Doc type for you language.

    However, there is still about 20 odd errors in your HTML file that you should fix. You can see them if you use the validator for html.

    Then we can start talking..

    ØØ

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: CSS: Code working in Mozilla/Opera but not in IE

    NoteMe,
    I fixed all the errors but man, does the site look even worse. Why would a tool like Dreamweaver even allow you to add things like this if they violate html rules? Well, I have lots to learn with these new changes will have to figure ways out to get the page looking better.

    Thanks to all that viewed and gave suggestions so far.

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: CSS: Code working in Mozilla/Opera but not in IE

    Quote Originally Posted by NoteMe
    I have no idea (since I am no web programmer) what inline or block mean. But display:block is supposed to go in the CSS file (if that answered the Q)
    It has to do with how the list items are displayed.... there's normal, block and inline.
    normal is like how we are used to seeing them:
    * Item 1
    * Item 2
    * Item 3
    etc...

    Block allows you to break it up a bit, similar to the "bad" look at the site given.

    Inline alows you to list them like this:
    * Item 1 * Item 2 * Item 3 * Item 4....etc

    Tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: CSS: Code working in Mozilla/Opera but not in IE

    Should be Transitional, not Translational
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

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



Click Here to Expand Forum to Full Width