CSS: IE 6 verdreifacht Div-Box Höhe trotz Angaben

  • CSS: IE 6 verdreifacht Div-Box Höhe trotz Angaben

    Hallo erstmal,
    ich code meine erste CSS Seite jetzt, also nicht wundern, wenn der Code miserabel ist.
    Hier zur Seite:
    klick mich

    In Opera und FireFox wird sie korrekt dargestellt, im IE wird die Box #menu statt 39px Höhe, mit Backgroundimage von 639x39px, mit 107px angezeigt, also das dreifache, dabei sind zweidrittel, also 78px untere Höhe leer.

    Hier der CSS Code:

    Quellcode

    1. /* WERTE FÜR ALLES */
    2. body {
    3. font-family:Verdana;
    4. font-size:10px;
    5. color:#e1e1e1;
    6. background-color:#7a7a7a;
    7. text-align:center;
    8. margin:0px;
    9. text-decoration: none;
    10. }
    11. /*DIE BOX DER GESAMTEN SEITE */
    12. #box {
    13. margin:0px auto;
    14. padding:0px;
    15. width:636px;
    16. height:670px;
    17. border:1px;
    18. }
    19. /* DER HEADER */
    20. #logo {
    21. background-image: url(logo.jpg);
    22. background-repeat:no-repeat;
    23. padding:0px;
    24. margin:0px;
    25. border:0px solid #000000;
    26. float:top;
    27. width:638px;
    28. height:220px;
    29. }
    30. /* TITLEBAR */
    31. #titlebar {
    32. padding:0px;
    33. margin:0px;
    34. border-right:1px solid #000000;
    35. border-left:1px solid #000000;
    36. float:top;
    37. width:636px;
    38. height:12px;
    39. background-color:#e1e1e1;
    40. }
    41. /* MENU PUNKTE */
    42. #menu {
    43. padding:0px;
    44. margin:0px;
    45. border-left:0px solid #000000;
    46. border-right:0px solid #000000;
    47. float:top;
    48. width:638px;
    49. height:39px;
    50. background-image:url(menu.jpg);
    51. background-repeat:no-repeat;
    52. }
    53. #links {
    54. padding:0px;
    55. margin:0px;
    56. border-left:0px solid #000000;
    57. width:68px;
    58. height:33px;
    59. float:left;
    60. }
    61. .button {
    62. text-decoration: none;
    63. line-height: 51px;
    64. padding:0px;
    65. margin:0px;
    66. border:0px solid #000000;
    67. width:100px;
    68. height:32px;
    69. float:left;
    70. text-align: right;
    71. }
    72. a.url, a.url:link, a.url:visited, a.url:active {
    73. color: #e1e1e1;
    74. text-decoration: none;
    75. }
    76. a.url:hover {color: #80ba4d;}
    77. #home {
    78. width:101px;
    79. height:32px;
    80. }
    81. .link_position {
    82. position: relative;
    83. right:5px;
    84. }
    85. #rechts {
    86. padding:0px;
    87. margin:0px;
    88. border-right:0px;
    89. width:69px;
    90. height:33px;
    91. float:right;
    92. }
    93. /* FREIRAUM */
    94. #space {
    95. padding:0px;
    96. margin:0px;
    97. border-left:1px solid #000000;
    98. border-right:1px solid #000000;
    99. background-color:#e1e1e1;
    100. width:636px;
    101. height:13px;
    102. }
    103. /* CONTENT BERREICH */
    104. #content {
    105. padding-left:5px;
    106. padding-right:5px;
    107. margin:0px;
    108. border-left:1px solid #000000;
    109. border-right:1px solid #000000;
    110. width:626px;
    111. height:371px;
    112. color:#000000;
    113. background-color:#e1e1e1;
    114. float:top;
    115. text-align: justify;
    116. }
    117. /* FOOTER */
    118. #footer {
    119. padding:0px;
    120. margin:0px;
    121. border:1px solid #000000;
    122. width:636px;
    123. height:12px;
    124. color:#000000;
    125. background-color:#e1e1e1;
    126. text-align: right;
    127. line-height:10px;
    128. }
    129. /* IMPRESSUM */
    130. .impressum, .impressum:link, .impressum:visited, .impressum:active {
    131. color: #6A6A6A;
    132. text-align: left;
    133. text-decoration: none;
    134. position: relative;
    135. right:342px;
    136. }
    137. .impressum, .impressum:hover {
    138. color: #000000;
    139. }
    140. /* BILDBOX */
    141. #img_box {
    142. padding:0px;
    143. margin-left:5px;
    144. background-image: url(img_box.jpg);
    145. width:212px;
    146. height:122px;
    147. float:right;
    148. position:relative; left:6px;
    149. }
    150. /* BILD */
    151. #img {
    152. padding:0px;
    153. margin-top:10px;
    154. width:202px;
    155. height:102px;
    156. float:right;
    157. background-color:#e1e1e1;
    158. background-image: url(img.jpg);
    159. }
    Alles anzeigen


    Ihr seit meine aller letzte Hoffnung hier, das ist das vierte Forum, in das ich mein Problem schreibe.
    In den anderen hat man mir nicht geholfen.
  • hi,

    hab mir jetzt noch keine details angeschaut, aber auf den ersten blick sind die kommentare in deinem html code falsch geschlossen:
    so sehen html kommentare aus: <!-- inhalt //-->

    ein scan mit http://validator.w3.org zeigt noch weitere fehler
    link: hier klicken

    korrigiere erstmal diese fehler, dann sehen wir weiter

    btw: das !important im css code hab ich vorher noch nie gesehen- scheint aber erlaubt zu sein ;)
  • habe es nochmal bearbeitet.
    Im Opera funktioniert es.
    Ich habe grade opera 9.01 installiert, und die Seite funktioniert damit wunderbar, ich weiss nicht was du hast.

    Und was meinst du mit "Works as Designed"?

    was soll eine Mindesthöhe bringen mit min-height:13px; in #space?

    Wäre schön, wenn jemand den Fehler findet.
    Danke

    EDIT: Wie kann man einen Absatz einer Liste <ul> unterdrücken?
  • Hier klicken

    Hier ist die Seite mit einem Menu in einer Liste.

    Quellcode

    1. /* WERTE FÜR ALLES */
    2. body {
    3. font-family:Verdana;
    4. font-size:10px;
    5. color:#e1e1e1;
    6. background-color:#7a7a7a;
    7. text-align:center;
    8. margin:0px;
    9. text-decoration: none;
    10. }
    11. /*DIE BOX DER GESAMTEN SEITE */
    12. #box {
    13. margin:0px auto;
    14. padding:0px;
    15. width:636px;
    16. height:670px;
    17. border:1px;
    18. }
    19. /* DER HEADER */
    20. #logo {
    21. background-image: url(logo.jpg);
    22. background-repeat:no-repeat;
    23. padding:0px;
    24. margin:0px;
    25. border:0px solid #000000;
    26. float:top;
    27. width:638px;
    28. height:220px;
    29. }
    30. /* TITLEBAR */
    31. #titlebar {
    32. padding:0px;
    33. margin:0px;
    34. border-right:1px solid #000000;
    35. border-left:1px solid #000000;
    36. float:top;
    37. width:636px;
    38. height:12px;
    39. background-color:#e1e1e1;
    40. }
    41. /* MENU PUNKTE */
    42. #menu {
    43. padding:0px;
    44. margin:0px;
    45. border-left:0px solid #000000;
    46. border-right:0px solid #000000;
    47. border:0px solid #000000;
    48. width:638px;
    49. height:39px;
    50. background-image:url(menu.jpg);
    51. background-repeat:no-repeat;
    52. }
    53. #links {
    54. padding:0px;
    55. margin:0px;
    56. border-left:0px solid #000000;
    57. width:68px;
    58. height:33px;
    59. float:left;
    60. }
    61. .button {
    62. text-decoration: none;
    63. line-height:0px;
    64. padding:0px;
    65. margin:0px;
    66. border:0px solid #000000;
    67. width:100px;
    68. height:33px;
    69. float:left;
    70. text-align: right;
    71. }
    72. .link-position {
    73. line-height:0px;
    74. padding-right:5px;
    75. }
    76. a.url, a.url:link, a.url:visited, a.url:active {
    77. color: #e1e1e1;
    78. text-decoration: none;
    79. }
    80. a.url:hover {color: #80ba4d;}
    81. ul {
    82. list-style-type:none;
    83. }
    84. #home {
    85. width:101px;
    86. }
    87. .link_position {
    88. position: relative;
    89. right:5px;
    90. }
    91. #rechts {
    92. padding:0px;
    93. margin:0px;
    94. border-right:0px;
    95. width:69px;
    96. height:33px;
    97. float:right;
    98. }
    99. /* FREIRAUM */
    100. #space {
    101. padding:0px;
    102. margin:0px;
    103. border-left:1px solid #000000;
    104. border-right:1px solid #000000;
    105. background-color:#e1e1e1;
    106. width:636px;
    107. height:13px;
    108. }
    109. /* CONTENT BERREICH */
    110. #content {
    111. padding-left:5px;
    112. padding-right:5px;
    113. margin:0px;
    114. border-left:1px solid #000000;
    115. border-right:1px solid #000000;
    116. width:626px;
    117. height:371px;
    118. color:#000000;
    119. background-color:#e1e1e1;
    120. float:top;
    121. text-align: justify;
    122. }
    123. /* FOOTER */
    124. #footer {
    125. padding:0px;
    126. margin:0px;
    127. border:1px solid #000000;
    128. width:636px;
    129. height:12px;
    130. color:#000000;
    131. background-color:#e1e1e1;
    132. text-align: right;
    133. line-height:10px;
    134. }
    135. /* IMPRESSUM */
    136. .impressum, .impressum:link, .impressum:visited, .impressum:active {
    137. color: #6A6A6A;
    138. text-align: left;
    139. text-decoration: none;
    140. position: relative;
    141. right:342px;
    142. }
    143. .impressum, .impressum:hover {
    144. color: #000000;
    145. }
    146. /* BILDBOX */
    147. #img_box {
    148. padding:0px;
    149. margin-left:5px;
    150. background-image: url(img_box.jpg);
    151. width:212px;
    152. height:122px;
    153. float:right;
    154. position:relative; left:6px;
    155. }
    156. /* BILD */
    157. #img {
    158. padding:0px;
    159. margin-top:10px;
    160. width:202px;
    161. height:102px;
    162. float:right;
    163. background-color:#e1e1e1;
    164. background-image: url(img.jpg);
    165. }
    Alles anzeigen


    Die Liste scheint in Opera einen Absatz zu machen, in dem das Hintergrundbild nach unten verschoben wird, obwohl es in einem anderen Div-Container ist.
    Ich kapiers nicht mehr. Bald blick ich nicht mehr durch.
  • sorry, wenn ich so penibel bin.
    aber falscher html code führt zu einer falschen anzeige

    und so lange der html code noch falsch ist, hat die arbeit am css gar keinen sinn

    ein <a> tag direkt unterhalb vom <ul> tag gibts halt nicht.. selbes problem beim <div>
    das muss alles ins <li> rein

    Quellcode

    1. <ul>
    2. <a class="url" href="http://kenubi.milten.lima-city.de/kenubis_folder/unzip_code/code/html_datei.htm">
    3. <div id="home" class="button">
    4. <li><span class="link-position">Home</span></li>
    5. </div>
    6. </a>
    7. ...
    8. </ul>
  • warum brauchst denn überhaupt das div mit der id "home"?
    und wozu eigentlich eine aufzählungsliste?

    also wenn ich mehrere spalten nebeneinander machen will, dann nehm ich meistens eine tabelle

    könnte es vielleicht sein, dass du das <div> nur im <a> hast, damit die klickfläche größer ist???

    dann wäre das hier ne alternative

    Quellcode

    1. <a href="#" style="display: block;width:100px;height:40px;border:1px solid #a9a9a9;">testlink</a>
  • Hier neue Seite

    Wow, danke für den Tip !!
    Jez hat meine Seite keine Fehler mehr :D und funktioniert sogar aufm IE wie in Opera!

    Hab deinen Code eingefügt und alles hat wunderbar geklappt.

    Hier der CSS Code:

    Quellcode

    1. /* WERTE FÜR ALLES */
    2. body {
    3. font-family:Verdana;
    4. font-size:10px;
    5. color:#e1e1e1;
    6. background-color:#7a7a7a;
    7. text-align:center;
    8. margin:0px;
    9. text-decoration: none;
    10. }
    11. /*DIE BOX DER GESAMTEN SEITE */
    12. #box {
    13. margin:0px auto;
    14. padding:0px;
    15. width:636px;
    16. height:670px;
    17. border:1px;
    18. }
    19. /* DER HEADER */
    20. #logo {
    21. background-image: url(logo.jpg);
    22. background-repeat:no-repeat;
    23. padding:0px;
    24. margin:0px;
    25. border:0px solid #000000;
    26. float:top;
    27. width:638px;
    28. height:220px;
    29. }
    30. /* TITLEBAR */
    31. #titlebar {
    32. padding:0px;
    33. margin:0px;
    34. border-right:1px solid #000000;
    35. border-left:1px solid #000000;
    36. float:top;
    37. width:636px;
    38. height:12px;
    39. background-color:#e1e1e1;
    40. }
    41. /* MENU PUNKTE */
    42. #menu {
    43. padding:0px;
    44. margin:0px;
    45. border-left:0px solid #000000;
    46. border-right:0px solid #000000;
    47. float:top;
    48. width:638px;
    49. height:39px;
    50. background-image:url(menu.jpg);
    51. background-repeat:no-repeat;
    52. }
    53. #links {
    54. padding:0px;
    55. margin:0px;
    56. border-left:0px solid #000000;
    57. width:68px;
    58. height:33px;
    59. float:left;
    60. }
    61. .url {
    62. text-decoration: none;
    63. border:0px solid #000000;
    64. width:100px;
    65. height:33px;
    66. float:left;
    67. text-align: right;
    68. }
    69. a.url, a.url:link, a.url:visited, a.url:active {
    70. color: #e1e1e1;
    71. text-decoration: none;
    72. }
    73. a.url:hover {color: #80ba4d;}
    74. #home {width:101px;}
    75. .link_position {
    76. position: relative;
    77. right:5px;
    78. top:20px;
    79. }
    80. #rechts {
    81. padding:0px;
    82. margin:0px;
    83. border-right:0px;
    84. width:69px;
    85. height:33px;
    86. float:right;
    87. }
    88. /* FREIRAUM */
    89. #space {
    90. padding:0px;
    91. margin:0px;
    92. border-left:1px solid #000000;
    93. border-right:1px solid #000000;
    94. background-color:#e1e1e1;
    95. width:636px;
    96. height:13px;
    97. }
    98. /* CONTENT BERREICH */
    99. #content {
    100. padding-left:5px;
    101. padding-right:5px;
    102. margin:0px;
    103. border-left:1px solid #000000;
    104. border-right:1px solid #000000;
    105. width:626px;
    106. height:371px;
    107. color:#000000;
    108. background-color:#e1e1e1;
    109. float:top;
    110. text-align: justify;
    111. }
    112. /* FOOTER */
    113. #footer {
    114. padding:0px;
    115. margin:0px;
    116. border:1px solid #000000;
    117. width:636px;
    118. height:12px;
    119. color:#000000;
    120. background-color:#e1e1e1;
    121. text-align: right;
    122. line-height:10px;
    123. }
    124. /* IMPRESSUM */
    125. .impressum, .impressum:link, .impressum:visited, .impressum:active {
    126. color: #6A6A6A;
    127. text-align: left;
    128. text-decoration: none;
    129. position: relative;
    130. right:342px;
    131. }
    132. .impressum, .impressum:hover {
    133. color: #000000;
    134. }
    135. /* BILDBOX */
    136. #img_box {
    137. padding:0px;
    138. margin-left:5px;
    139. background-image: url(img_box.jpg);
    140. width:212px;
    141. height:122px;
    142. float:right;
    143. position:relative; left:6px;
    144. }
    145. /* BILD */
    146. #img {
    147. padding:0px;
    148. margin-top:10px;
    149. width:202px;
    150. height:102px;
    151. float:right;
    152. background-color:#e1e1e1;
    153. background-image: url(img.jpg);
    154. }
    Alles anzeigen


    Super vielen dank, hab schon gedacht, eine neue Navi zu machen ;)

    Und noch ne frage:
    Kann man Texte in einer externen Datei in den Content einfügen?
    Und da es meine erste Seite ist, die überhaupt schonmal funktioniert,
    muss ich jetzt für jede mögliche Seite, also Home, About, Works, Guestbook und Contact eine zusätzliche Html machen mit dem Inhalt?[/url]