tutorials.de Buch-Aktion 05/2012
ERLEDIGT
JA
ANTWORTEN
2
ZUGRIFFE
841
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    blizz-faad Tutorials.de Gastzugang
    Guten Abend,
    habe ein kleines Problem mit meinem Footer. Eigentlich ist dieser immer unten am Browserrand, außer wenn der "content"-Bereich zu lang ist (height). Gut am anhängenden Screenshot zu sehen.

    CSS-Datei:
    PHP-Code:
    htmlbody margin0pxpadding0pxheight100%; background#888888; font: 13px Trebuchet MS; color: #FFFFFF; }
    html>body #container { height: auto; }
    #container { position: relative; min-height: 100%; height: 100%; height: auto; }
    #header_bg { position: absolute; width: 100%; height: 95px; background: #121A33; }
    #header { position: absolute; padding: 5px; left: 50%; margin-left: -40%; width: 79%; min-width: 630px; height: 85px; background: #FF0000; }
    #content_head { position: absolute; margin: 110px 0px 0px 0px; padding: 5px; left: 50%; margin-left: -40%; width: 79%; min-width: 630px; background: #121A33; }
    #content { position: absolute; margin: 138px 50px 50px 50px; padding: 5px; left: 50%; margin-left: -40%; width: 79%; min-width: 630px; background: #4D515D; }
    #footer_bg { position: absolute; width: 100%; height: 40px; background: #121A33; bottom: 0px; }
    #footer { position: absolute; padding: 5px; left: 50%; margin-left: -40%; width: 79%; min-width: 630px; height: 30px; bottom: 0px; background: #FF0000; }

    span.footer font-size11pxcolor#898D99; } 
    Index-Datei:
    PHP-Code:
    <div id="container">
      <
    div id="header_bg">
        <
    div id="header">
          
    Header
        
    </div>
      </
    div>
      <
    div id="content_head">
        
    Startseite
      
    </div>
      <
    div id="content">
        
    test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test<br />test1<br />
      </
    div>
      <
    div id="footer_bg">
        <
    div id="footer">
          <
    span class="footer">Footer</span>
        </
    div>
      </
    div>
    </
    div
    Miniaturansicht angehängter Grafiken Miniaturansicht angehängter Grafiken Footer nicht immer ganz unten am Browserrand?-testscreen.jpg  
     

  2. #2
    Maik Tutorials.de Gastzugang
    Moin.
    Zitat Zitat von blizz-faad Beitrag anzeigen
    habe ein kleines Problem mit meinem Footer. Eigentlich ist dieser immer unten am Browserrand, außer wenn der "content"-Bereich zu lang ist (height).
    Die Ursache ist die absolute Positionierung von #content, mit der der Block aus dem normalen Textfluß genommen wird.

    Das ähnliche Problem hatten wir aber doch schon mal: Frage bezüglich Position

    mfg Maik
     

  3. #3
    Maik Tutorials.de Gastzugang
    Alternativumsetzung des Layouts ohne absolute Positionierungen (bis auf #footer), mit der der Footer nun bei zunehmenden Inhalt auch nach unten wandert:
    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    html, body { margin: 0px; padding: 0px; height: 100%; background: #888888; font: 13px Trebuchet MS; color: #FFFFFF; }
    html>body #container { height: auto; }
    #container { position: relative; min-height: 100%; height: 100%; height: auto; }
    #header_bg {  width: 100%; height: 95px; background: #121A33; }
    #header {  padding: 5px; margin:0 auto; width: 79%; min-width: 630px; height: 85px; background: #FF0000; }
    #content_head {  padding: 5px;  margin:0 auto; width: 79%; min-width: 630px; background: #121A33; }
    #content {  padding: 5px 5px 40px 5px;  margin:0 auto; width: 79%; min-width: 630px; background: #4D515D; }
    #footer_bg { position: absolute; width: 100%; height: 40px; background: #121A33; bottom: 0px; }
    #footer { padding: 5px; margin:0 auto; width: 79%; min-width: 630px; height: 30px; background: #FF0000; }


    mfg Maik
     

Ähnliche Themen

  1. Antworten: 16
    Letzter Beitrag: 18.09.08, 16:42
  2. Footer immer ganz unten
    Von Merbi im Forum CSS
    Antworten: 4
    Letzter Beitrag: 13.02.08, 21:26
  3. Antworten: 16
    Letzter Beitrag: 03.04.07, 13:05
  4. Footer immer ganz unten
    Von HPB im Forum HTML & XHTML
    Antworten: 3
    Letzter Beitrag: 15.09.04, 16:47
  5. Footer immer nach unten ausrichten (Wie?)
    Von Stegie im Forum HTML & XHTML
    Antworten: 0
    Letzter Beitrag: 14.04.02, 20:02