pdongus84: Div mit position: absolute; scrollt nicht mit

Hallo,

ein Element mit position: absolute; ist ja so definiert, dass es mitscrollt. In meinem Fall tut das auch im Firefox so.
Das Problem tritt erst im Internet Explorer (6 oder 7)auf. Hier scrollt das DIV nicht mit. Ist hier ein Problem des IE bekannt?

  1. Hallo,

    Hier scrollt das DIV nicht mit. Ist hier ein Problem des IE bekannt?

    m.E. nicht, ausser du hättest einen Workaround für IE 6 und position:fixed eingebaut.
    Hast du eine URI oder etwas Code von deiner Seite?

    Grüsse
    Cyx23

    1. <!DOCTYPE html
           PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      <!-- Design & Programming by CELL | www.cell-bc.de //-->
      <html><head>
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
      </head>
        <body>
          <div style="height:140px;overflow:auto;background-color:blue;">
       da<br /><br />
       dort<br /><br />
       <div style="position:relative;">
         <div style="position:absolute;background-color:red;">
           dasda>
                </div>
       </div>
       hier<br /><br />
       das<br /><br />
       hmmm<br /><br />
       ohhhh<br /><br />
       warum????<br /><br />
       Häh?
          </div>
        </body>
      </html>

      Die Kombination aus relative und absolute kommt daher, dass dieser div über dem inhalt liegen muss und eben mitgescrollt werden muss. Wie gesagt, im Firefox kein Problem, IE macht das garnet.

      1. hi,

        Die Kombination aus relative und absolute kommt daher, dass dieser div über dem inhalt liegen muss und eben mitgescrollt werden muss. Wie gesagt, im Firefox kein Problem, IE macht das garnet.

        Die relative Positionierung allein ist schon das Problem.

        IE6 bug with overflow and position:relative
        "This page demonstrates a bug in Windows Internet Explorer 6 strict/transitional modes which causes relative positioned content to spill outside of an overflow constricted container. [...]

        This bug does not appear in quirks mode, which is the only known workaround (to this author) at this time."

        Was für ein Glück, das wir uns nicht nur auf das verlassen müssen, was dieser Autor "at this time" wusste - position:relative and overflow in Internet Explorer berichtet vom gleichen Problem, und liefert auch den simplen Workaround gleich mit:

        "To solve this, I added position:relative to the container. This seems to work for both IE6 and 7."

        Ja, Google ist was feines. Probiere doch bei Gelegenheit auch mal aus, ob du nicht doch in der Lage bist, es zu benutzen.

        gruß,
        wahsaga

        --
        /voodoo.css:
        #GeorgeWBush { position:absolute; bottom:-6ft; }
        1. Hallo,

          Danke, da bin ich wohl tatsächlich unfähig, google zu verwenden, ich hab nämlich da keine Infos dazu gefunden(Trotz längerer Suche). Dann muss ich das wohl mal testen.

          Vielen Dank.

          1. So, gleich getestet.
            position:relative; auf den Container ist Gold wert, dann tut es wunderbar.
            Nochmals danke.

          2. hi,

            Danke, da bin ich wohl tatsächlich unfähig, google zu verwenden,

            Sagen wir, du hast Potential zum Dazulernen :-)

            ich hab nämlich da keine Infos dazu gefunden(Trotz längerer Suche).

            Wonach hast du denn gesucht?

            Ich dachte mir, ie bug position relative overflow sollten passende Suchbegriffe sein - und bekam damit die beiden genannten Seiten als ersten reps. dritten Treffer.

            gruß,
            wahsaga

            --
            /voodoo.css:
            #GeorgeWBush { position:absolute; bottom:-6ft; }