Free2Code
 
Time: 2008-11-21, 08:34pm
DIV element in IE not working
Subject: DIV element in IE not working  ·  Posted: 2005-09-29, 05:29pm
Rank: ? (3)
Member #: 25408
Hi folks,

I've been working hard on extending the example login script and have been working on a simple menu system using DIV but I was testing my code in IE and not Mozilla as I read that DIV support is better in IE than Mozilla as Mozilla would normally use Layers.

Anyway I've got some generated code from a php script and I've tested the same code in IE and Mozilla and it seems not to work in IE but its fine in Mozilla

Code:
  1. <html>
  2. <head>
  3. <title>Home</title>
  4. <style type="text/css">
  5.     #home{
  6.         position: absolute;
  7.         top: 60px;
  8.         left: 120px;
  9.         width: 150;
  10.         height: 400;
  11.         padding: 4px;
  12.         border: solid red 5px;
  13.         z-index: 3;
  14.     }
  15.     #menu{
  16.         position: absolute;
  17.         top: 60px;
  18.         left: 60px;
  19.         width: 100;
  20.         height: 300;
  21.         padding: 4px;
  22.         border: solid blue 5px;
  23.         z-index: 2;
  24.     }
  25.     </style>
  26. </head>
  27. <body>
  28. <div id="menu">
  29. <table border="1">
  30. <tr><td><a href="home.php">Home</a></td></tr>
  31.   <tr><td><a href="home.php?menu=1">My Details</a></td></tr>
  32.   <tr><td><a href="home.php?menu=2">Show Selection</a></td></tr>
  33.   <tr><td><a href="home.php?menu=3">Edit Selection</a></td></tr>
  34.   <tr><td><a href="logout.php">Logout</a></td></tr>
  35. </div>
  36. <div id="home">
  37. <p> !!!!!! No Option selected !!!!!
  38. </div>
  39. </body>
  40. </html>


Can any of you folks tell me what is wrong from an IE point of view.

Thanks in advance
Carl

 
  Reply to this ·  Post link ·  Top
Subject: Re: DIV element in IE not working  ·  Posted: 2005-09-30, 03:20am
Rank: ? (4821)
Member #: 3416
I read that DIV support is better in IE than Mozilla as Mozilla would normally use Layers.

i'm not sure where you read that, but it's completely wrong. both browsers do perfectly fine with div tags, though ie has some issues with applying css.

the problem you're having though is probably due to your html having problems: you didn't close the table tag. i inserted </table> before the closing div tag from #menu and everything displayed the same in firefox and ie, though it caused #home to overlap #menu since it's no longer contained within #menu...

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top
Subject: Re: DIV element in IE not working  ·  Posted: 2005-11-18, 04:52pm
Rank: ? (779)
Member #: 14565
IE has problems with everything. It's a pain especially for positioning DIVs in Firefox vs. IE...

- Little Freeland (Ryan) http://ryanfreeland.org << NEW WEBSITE!
 
  Reply to this ·  Post link ·  Top
Subject: Re: DIV element in IE not working  ·  Posted: 2006-01-21, 11:58am
Rank: ? (90)
Member #: 1672
IE is more of a nazi when it comes to error checking CSS code. Just like the W3C validator.

However I find Firefox more frustrating to work with then IE.

Meh!
 
  Reply to this ·  Post link ·  Top
Subject: Re: DIV element in IE not working  ·  Posted: 2006-01-22, 09:51am
Rank: ? (779)
Member #: 14565
Then you are wierd, stu.

DO NOT STANDARDIZE YOUR WEBSITES TO IE! IE IS NOT A MODERN WEB BROWSER ANYMORE!

FORCE PEOPLE TO USE ALTERNATIVE BROWSERS!

- Little Freeland (Ryan) http://ryanfreeland.org << NEW WEBSITE!
 
  Reply to this ·  Post link ·  Top
Subject: Re: DIV element in IE not working  ·  Posted: 2006-01-23, 07:44am
Rank: ? (4821)
Member #: 3416
IE is more of a nazi when it comes to error checking CSS code. Just like the W3C validator.

do you mean because there's a lot of css that ie doesn't support, or something else? generally ie is very lax in what it accepts (good for users, bad for developers). i would say that mozilla is the strict one since one of its goals has been to promote standards where ie is mostly concerned with being the most popular browser. if you want to make a site that works okay in all current browsers, the generally-agreed easiest is to code to standards and test first in a gecko-based browser, then check in ie and any other engines you care about and tweak things from there. of course it's always easiest to just pick one browser and only develop for that, but it's far from the best way.

FORCE PEOPLE TO USE ALTERNATIVE BROWSERS!

by locking them out of the most common alternative? that's not the best way to convince people. i simply have a list of things that each browser doesn't support (or has a bug with) so people can read about what they're missing.

my mind is like a steel trap! it only hangs on to the big stuff. visit my forums at track7.org
 
  Reply to this ·  Post link ·  Top

Pages: 1

Please login or register to post a reply.

icons