By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,788 Members | 1,115 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,788 IT Pros & Developers. It's quick & easy.

CSS looks good in firefox but not in IE

P: 2
I have a problem with my website:
http://www.eecs.tufts.edu/~pgoran01/abet/

I'm using tabbed menus, all of them pop up when you login.

However, the interface looks good in firefox but when I open it in IE the background color of the subtab bar seems to stop halfway down and split through the subtab text. I got this CSS tab template somewhere on the web and I can't find it anymore. It seems that the CSS code I'm using it's working fine on Firefox but I need it to work on all browsers. Can someone see where my problem is. Here is the CSS code I'm using:
Expand|Select|Wrap|Line Numbers
  1. html {
  2.     min-width: 600px;
  3.     background: #4169E1;
  4.     padding: 0.5em 2em 3em 2em;
  5. }
  6.  
  7. body, div, td, th, h2, h3, h4 { /* redundant rules for bad browsers  */  
  8.     font-family: verdana,sans-serif;
  9.     font-size:    x-small;
  10.     voice-family: "\"}\"";
  11.     voice-family: inherit;
  12.     font-size: small;
  13.     color: #333;
  14. }  
  15.  
  16. a { color: #06C; }
  17. a:hover { color: #333; }
  18. a:active { color: #000; }
  19.  
  20. p { line-height: 140%; }
  21.  
  22. h1 {
  23.     font-family: trebuchet ms,arial,verdana,sans-serif;
  24.     font-weight: bold;
  25.     font-size: 140%;
  26.     color: #333;
  27.     padding-bottom: 2px;
  28.     border-bottom: 1px dotted #CCC;
  29.     margin: 0;
  30. }
  31.  
  32. .note {
  33.     background: #EEE;
  34.     padding: 4px;
  35.     font-family: tahoma,verdana,sans-serif;
  36.     font-size: 85%;
  37.     line-height: 130%;
  38. }
  39.  
  40. #main {
  41.     text-align: left;
  42.     border: 1px solid #666;
  43.     background: #FFFDF3; 
  44.     clear: both;
  45.     width: 98%;
  46.     margin-top: -1px;
  47. }
  48.  
  49. #bodyarea {
  50.     padding: 20px;
  51.     min-height: 300px;
  52. }
  53.  
  54. #topbar {
  55.     padding-bottom: 0.5em;
  56.     font-family: trebuchet ms,verdana,sans-serif;
  57.     font-weight: bold;
  58.     font-size: 200%;
  59. }
  60.  
  61. #topbar a { text-decoration: none; color: white; }
  62.  
  63. #topbar a:hover { text-decoration: underline; }
  64.  
  65. /*///////////// Tabs Code ////////////*/
  66.  
  67. #tabs {
  68.     font-family: tahoma,verdana,sans-serif;
  69.     font-size: 85%;
  70.     clear: both;
  71.     text-align: center;
  72. }
  73.  
  74. #tabs ul {
  75.     display: inline;
  76.     list-style-type: none;
  77.     margin: 0;
  78.     padding: 0;
  79. }
  80.  
  81. #tabs li { float: left; }
  82.  
  83. #tabs a,span { width: 90px; }
  84.  
  85. #tabs span {
  86.     position: relative;
  87.     top: 0;
  88.     margin: 0 2px 0 0;
  89.     float: left;
  90.     background: #FFF3B3;
  91.     border-right: 1px solid #666;
  92.     border-top: 1px solid #666;
  93.     border-left: 1px solid #666;
  94.     padding: 6px 4px 6px 10px;
  95.     text-decoration: none;
  96.     color: #333;
  97. }
  98.  
  99. #tabs a {
  100.     position: relative;
  101.     top: 0;
  102.     margin: 1px 2px 0 0;
  103.     float: left;
  104.     background: #FFFAE1;
  105.     border-right: 1px solid #AAA;
  106.     border-top: 1px solid #AAA;
  107.     border-left: 1px solid #AAA;
  108.     padding: 5px 4px 5px 10px;
  109.     text-decoration: none;
  110.     color: #333;
  111. }
  112.  
  113. #tabs a:hover {
  114.     background: #FFF7CD;
  115.     position: relative;
  116.     top: 0;
  117.     padding: 5px 4px 6px 10px;
  118.     margin-top: 0px;
  119. }
  120.  
  121. #tabs a.active {
  122.     position: relative;
  123.     top: 0;
  124.     margin: 0 2px 0 0;
  125.     float: left;
  126.  /*    background: #FFF3B3; */
  127.         background: #FFDEAD;
  128.     border-right: 1px solid #666;
  129.     border-top: 1px solid #666;
  130.     border-left: 1px solid #666;
  131.     padding: 6px 4px 6px 10px;
  132.     text-decoration: none;
  133.     color: #333;
  134. }
  135.  
  136. #tabs a.active:hover {
  137.     position: relative;
  138.     top: 0;
  139.     margin: 0 2px 0 0;
  140.     float: left;
  141.     background: #FFF3B3;
  142.     border-right: 1px solid #666;
  143.     border-top: 1px solid #666;
  144.     border-left: 1px solid #666;
  145.     padding: 6px 4px 6px 10px;
  146.     text-decoration: none;
  147.     color: #333;
  148. }
  149.  
  150. #subtabs ul {
  151.     list-style-type: none;
  152.     margin: 0px;
  153.     padding: 0px;
  154. }
  155.  
  156. #subtabs li {
  157.     float: left;
  158.     padding: 0 8px 0 8px;
  159.     border-left: 1px solid #CCC;
  160.     white-space: nowrap;
  161. }
  162.  
  163. #subtabs li.list2 {
  164.     float: right;
  165.     padding: 0 8px 0 8px;
  166.     border-left: 1px solid #CCC;
  167. //    white-space: nowrap;
  168. }
  169.  
  170. #subtabs li:first-child { border-left: none; }
  171.  
  172. #subtabs {
  173.     font-family: tahoma,verdana,sans-serif;
  174.     font-size: 85%;
  175.     background: #FFDEAD;
  176.  
  177.     color: #666;
  178.     padding: 5px 7px 7px 7px; /* for All other Browsers */
  179.  
  180.  
  181. }
  182.  
Feb 2 '07 #1
Share this Question
Share on Google+
5 Replies


tolkienarda
100+
P: 316
Hi

I didn't see anything blatent in the code but somthing you should try is a css valadation program, if you are using firefox you should download the webdeveloper toolbar which is awesome and under tools there is a series of valadate programs use the valadate css and validate html this will check and make sure youre code is completely compliant, most pages have some errors and most of the time those don't matter. but this might pick up somthing everyone elce is overlooking. i havent installed it on my new laptop yet or i would do it for you.

another thing to look into is docutype descriptions and quirk mode in IE do a search on w3schools for quirk mode and valadate programs. what happens when your dtd is wrong your browser will load in quirk mode which means that IE sees the code as if it were an older browser, which may not accept your css or maybe some code in it.

eric
Feb 2 '07 #2

drhowarddrfine
Expert 5K+
P: 7,435
Also, see the sticky at the top of this forum.
Feb 2 '07 #3

P: 2
Also, see the sticky at the top of this forum.
I added the DTD type as you said in the sticky. This was very helpful so now my fonts are all the same size in Firefox and in IE. But still in IE the colored bar behind the sub tabs isn't working right. It's getting cutoff halfway down. It's strange that this fixed the font problem but not the tabs problem. IE is really stubborn why doesn't it just work as well as firefox? I'm no CSS expert so I could use some help figuring out why there is a difference when using these two browsers.

The website is:
http://www.ece.tufts.edu/~pgoran01/abet
Feb 8 '07 #4

tolkienarda
100+
P: 316
i've been looking over your page in ie and firefox the differences aren't very big and i am thinking that the problem either that some settings are different in the firefox and ie preferences or it could be just that IE and firefox translate code sightly differently. the differences i see are that the white box over the blue bg is larger in firefox and there is a small line between the tab and the header of the content box also in firefox and the dotted lines are different, (more dashed in IE and dots if firefox) if there are more differences than these then there is probably somthing different in our browser configs if not then it is just a difference between the two and there is nothing that can be done. if firefox were exactly the same as ie it wouldn't be the awesome browser it is.

eric
Feb 8 '07 #5

drhowarddrfine
Expert 5K+
P: 7,435
IE is the worst browser on the planet and nine years behind web standards. But, beyond that, you have 41 html errors and, potentially, some css errors but clean up the html first.

Your first one is you must use quotes around class and id names, eg, class="list"
Feb 9 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.