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

DIV positioning fine in Firefox but out of place in IE

P: 2
I'm sorry to post what is ultimately a myspace problem, but I'm sure I'd still be having this problem with any html/css document, so the answer would more than likely be able to help anyone out. I'm pretty sure I know what the problem is already. I just don't know how to fix it. I'd be very grateful of any help. I'll post what I'm trying to do, what keeps happening, what I believe the problem is, the link to my page and the css, and things that I have already tried:

What I'm trying to do:
Basically, I'm trying to lower all the tables in Myspace and place my own DIVs in the new leftover space above them.

What keeps happening:
In Firefox, everything is perfect so far. In IE, however, my DIVs are way out of place from the top.

What I believe the problem is:
Well, after countless hours of looking into this, it seems IE is treating my created DIVs as though they are one of the Myspace tables, and is lowering their position on the page as well. The horizontal positioning from the left seems okay, though. See for yourself in both browsers:

http://www.myspace.com/theceejus (links don't seem to be working with this site)

The CSS (what I think the problem is in bold)
Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. .extras1 { background-image:url("http://s9.imagehosting.us/uploadpoint/imagehosting_upload_storage/nouser_1636/T0_-1_1636270.gif");  
  3. border:5px solid; border-color:000000;
  4. width:700px; height:366px;
  5. position:absolute; z-index:2; left:156; top:142; !important;}
  6.  
  7. .extras2 {
  8. background-image:url("http://img101.imageshack.us/img101/1681/ceejsigek6.jpg");  
  9. border:5px solid; border-color:000000;
  10. width:350px; height:250px;
  11. position:absolute; z-index:2; left:156; top:535; !important;}
  12.  
  13. .extras3 {
  14. background-image:url("http://img47.imageshack.us/img47/2029/cjwelcomeve9.gif");  
  15. border:5px solid; border-color:000000;
  16. width:350px; height:250px;
  17. position:absolute; z-index:2; left:506; top:535; !important;}
  18.  
  19. .extras4 {
  20. background-color:transparent;
  21. border:1px solid; border-color:000000;
  22. width:274px; height:146px;
  23. z-index:3; left:546; top:600;
  24. position:absolute; text-align:justify; !important;}
  25.  
  26. .mygen { Background Properties }
  27. table, tr, td { background-color:transparent; border:none; border-width:0;}
  28.  
  29. body {
  30.     background-image: url('http://img220.imageshack.us/img220/233/ceejsidezn1.gif');
  31.     background-attachment: fixed;
  32.     background-repeat: no-repeat;
  33.     background-position: center left;}
  34. span.blacktext12 {
  35.  scrollbar-face-color:FFFFFF;
  36.  scrollbar-highlight-color:FFFFFF;
  37.  scrollbar-3dlight-color:000000;
  38.  scrollbar-shadow-color:FFFFFF;
  39.  scrollbar-darkshadow-color:000000;
  40.  scrollbar-arrow-color:FFFFFF;
  41.  scrollbar-track-color:FFFFFF;
  42.   }
  43.  
  44. .mygen { Table Properties }
  45. table table table table {border:0px;}
  46. td.text table, td.text table td {width:400px; padding:0px;}
  47. td.text table table table table, 
  48. td.text table table table table td {width:0px;}
  49. table table {position:relative; bottom: -654px;}
  50. table table table {position:static;}
  51. table table { border: 0px }
  52. table table table table{border:0px}
  53. table table td.text table td.text table table {background-color:transparent;}
  54. table table table {
  55.  border-style:solid;
  56.  border-width:5px;
  57.  border-color:000000;
  58.  background-image:url('http://img119.imageshack.us/img119/8806/grid2ju3.gif');
  59.  background-repeat: repeat;
  60.  background-attachment: fixed
  61.       }
  62.  
  63. .mygen { Text Properties }
  64. table, tr, td, li, p, div { font-family:tahoma; color:000000; font-size:9px;     } 
  65. .btext { font-family:arial; color:000000;  text-decoration:overline;      } 
  66. .blacktext10 { font-family:courier new; color:CCCCCC;      } 
  67. .blacktext12 {   font-size:0px;     } 
  68. .lightbluetext8 { font-family:impact; color:000000; font-size:10px; font-weight:normal; border:1px solid;     } 
  69. .orangetext15 { font-family:tahoma; color:CC4422; font-size:10px;     } 
  70. .redtext { font-family:verdana; color:CC8822; font-size:12px; font-weight:bold;     } 
  71. .redbtext { font-family:verdana; color:CC8822; font-size:12px; font-weight:bold;     } 
  72. .text { font-family:courier new; color:AAAAAA; font-size:12px;     } 
  73. .whitetext12 { font-family:tahoma; color:CC4422; font-size:10px;     } 
  74. a:active, a:visited, a:link { font-family:tahoma; color:CC8822; font-size:9px; font-weight:normal; text-decoration:underline;     } 
  75. a:hover { font-family:tahoma; color:CC8822; font-size:9px;     } 
  76. a.navbar:active, a.navbar:visited, a.navbar:link { font-family:tahoma; color:000000; font-size:9px;     } 
  77. a.navbar:hover { font-family:tahoma; color:FFFFFF; font-size:9px;     } 
  78. a.redlink:active, a.redlink:visited, a.redlink:link { font-family:tahoma; color:CC8822; font-size:9px; font-weight:normal; text-decoration:underline;     } 
  79. a.redlink:hover { font-family:tahoma; color:CC8822; font-size:9px; font-weight:normal; text-decoration:underline;     } 
  80. .nametext { font-family:verdana; color:EECC22;      } 
  81.  
  82. .mygen { Miscellaneous Properties }
  83. a:hover img { filter:Blur(Add = 0,  Direction = 225,  Strength = 10);}
  84. tr {background:transparent;}
  85. body table div font a, body table div div {visbility:hidden;}
  86. body table table div font a, body table table div div {visibility:visible;}
  87. </style>
  88.  
  89. <style type="text/css">
  90. table table table td {vertical-align:top;}
  91. span.blacktext12 {
  92. background-color:transparent;
  93. background-image:url("http://img215.imageshack.us/img215/1360/myspacebanner4cf0.gif");
  94. background-position:center center;
  95. font-size:0px; letter-spacing:-0.5px;
  96. width:400px; height:100px; display:block; }
  97. </style>
  98.  
  99. <style>
  100. .{hiding the bottom links}
  101. table tr td div div {visibility:hidden;border:0px!important;background-color:transparent;}
  102. </style>
  103.  
  104. <style>
  105. .a {hide copyright}
  106. table div font {visibility:hidden;}
  107. table table div font {visibility:visible;}
  108. </style>
  109.  
  110. <style>body div table tbody tr td font {visibility:hidden;}
  111. .navbar {visibility:visible;}
  112. .navbar font {visibility:hidden;}</style>
  113.  
  114. <style>body div table tbody tr td font {position:absolute; top:120px;
  115. left:50%;
  116. margin-left:-318px;
  117. z-index:9}
  118. .navbar {visibility:visible;}
  119. .navbar font {visibility:hidden;}</style>
  120.  
  121. <style>
  122. table table td {width:10px;}
  123. div table table td, table table table td {width:auto;}
  124. table table img {display:none;}
  125. table table table img {display:inline;}
  126. td.text td.text table table div,
  127. </style>
  128.  
  129. <style>
  130. div table table a.navbar {visibility:visible; !important;}
  131. </style>
  132.  
  133. <div class="extras1">
  134. </div>
  135.  
  136. <div class="extras2">
  137. </div>
  138.  
  139. <div class="extras3">
  140. </div>
Is there an extra tag I can add in there to make IE keep the positioning the way I set it to, or is there no possible solution to this mess?

Other things I have tried
- Setting a doctype. Basically, you can't. You have to work with what myspace gives you, which is basically no doctype.
- Setting the repositioning of the tables to absolute instead of relative. Setting it to anything else but relative messes the positioning up even more.
- Leaving out a position. That screwed up my positioning more than just about anything I tried.
- Putting the position tag inside the DIV itself rather than in the CSS styles. That basically didn't do anything. It had the same effect.
- Setting the left tag to 50% and the top tag to 0%, then using margin-top and margin-left to position it from there. That still didn't fix my IE problem, not to mention the effect was still no different.
- I can't position them as plain images because I plan on putting text over the one that says "Welcome", which will be the extras4 div that I decided not to show just yet.
- Placing an "!important;" tag inside the tags. That did absolutely nothing.
- Using javascript to fix the problem. You can't. Myspace filters it.

With that said, I know for a fact the solution to this must be fairly simple, if there is one. It may look like a complex problem in text, but it's really not. I just have no clue what so ever on how to fix this. If you know the answer, then hands down... you are a genius with html/css. Thanks beforehand for any suggestions BTW. Again, I would really appreciate any assistance.
Oct 2 '06 #1
Share this Question
Share on Google+
4 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Will try and answer some of your questions.
1) IE will never perform correctly without a proper doctype. So this is a big hangup with myspace and other free web sites which tend to throw a wrench into proper web development. Right now, IE is in 'quirks' mode.
Oct 2 '06 #2

drhowarddrfine
Expert 5K+
P: 7,435
Will try and answer some of your questions.
1) IE will never perform correctly without a proper doctype. So this is a big hangup with myspace and other free web sites which tend to throw a wrench into proper web development. Right now, IE is in 'quirks' mode.
2) Using tables for layout is a no-no. I've never done it that way so I can't help with that.
Oct 2 '06 #3

drhowarddrfine
Expert 5K+
P: 7,435
IE tends to screw up margins and padding on borders so try adding *{margtin:0;padding:0} to your css.
Oct 2 '06 #4

P: 2
Will try and answer some of your questions.
1) IE will never perform correctly without a proper doctype. So this is a big hangup with myspace and other free web sites which tend to throw a wrench into proper web development. Right now, IE is in 'quirks' mode.
2) Using tables for layout is a no-no. I've never done it that way so I can't help with that.
Well, I'm not actually creating any tables. I'm just moving the Myspace tables further down the page, and adding in DIVs where they originally were. Many people choose to hide these myspace tables, then make the entire thing with DIVs. That always works. However, I don't wanna get rid of those tables, so I'm just moving them down with that part of the CSS that states:

Expand|Select|Wrap|Line Numbers
  1. table table {position:relative; bottom: -654px;}
  2. table table table {position:static;}
The problem is that in IE, that little bit of coding is also bringing my DIVs further down the page along with the tables. In Firefox, the DIVs are unaffected by this. So basically, what IE is obviously doing is treating my DIVs as though they are tables with that coding listed above. I'm just thinking there must be something else I can add in my coding to prevent IE from bringing the DIVs down with the tables. A code to seperate them more or less. Any ideas? BTW, I really appreciate the help.
Oct 2 '06 #5

Post your reply

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