Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
problem ze stopką
#1
witam, robię stronę za pomocą page scrollera, jednak coś mi się nie zgadza w blokach strony. Chciałem, żeby stopka wyświetlana była u dołu strony, a ona zawędrowała gdzieś na środek Smile Proszę o pomoc

Kod strony (same div'y):
Kod:
<div id="container">
    <div id="header">
        <div id="head">
            <div class="col_6">
                xxxxxxxx
            </div>
            <div class="col_6">
                <a href="#howtouse" class="nav-button">How to Use</span></a>
                <a href="#examples" class="nav-button">Examples</span></a>
                <a href="#credits" class="nav-button">Credits</span></a>
            </div>
        </div>
    </div>
    
    <div id="middle">
        <div class="slide" id="howtouse">
        xxxxx
        </div>
        
        <div class="slide" id="examples">
        xxxxx
        </div>
        
        <div class="slide" id="credits">
        xxxxx
        </div>
</div>
    <div id="footer">
    <div id="footer-img">
    <div id="footer-text">
</div>
</div>

Kod CSS:
Kod:
html, body {
    background: url(../img/back.png) repeat;
    background-attachment: fixed;
    font-family: Arial, Helvetica, Verdana, sans-serif;
    color: #fff;
    margin: 0;
    padding: 0;
    height: 100%;
}

#container {
  min-height:100%;
  position:relative;
}

#header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    background: #3D3D3D;
    border-bottom: dotted 1px #000;
    padding: 5px;
    height: 100px;
}

#head {
    width: 990px;
    margin-left: auto;
    margin-right: auto;
}

.nav-button {
    padding: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 12px;
}

.current, a.nav-button:hover {
    color: #000;
}

#middle {
    color: #000;
}

.slide {
    margin: 0 auto;
    text-align: justify;
    width: 990px;
    padding: 130px;
    height: 500px;
}

#footer {
    margin: 0 auto;
      position:absolute;
  bottom:0;
    width: 100%;
    height: 65px;
}

#footer-img {
    background: url(../img/zabek.png) repeat-x;
    height: 5px;
}

#footer-text {
    widht: 990px;
    margin-left: auto;
    margin-right: auto;    
    height: 60px;
    background-color: #3D3D3D;
}
Odpowiedz
#2
Gołym okiem widać że masz więcej div'ów otwartych niż zamkniętych ... #container ma position:relative i w nim musisz umieścić #footer żeby stało się tak jak chcesz. Jeżeli #footer będzie bezpośrednio w body to wtedy body będzie do niego relative i #footer przyklei Ci się do dołu przeglądarki ...
Odpowiedz
#3
(24-01-2013, 17:18)atp napisał(a): Gołym okiem widać że masz więcej div'ów otwartych niż zamkniętych ... #container ma position:relative i w nim musisz umieścić #footer żeby stało się tak jak chcesz. Jeżeli #footer będzie bezpośrednio w body to wtedy body będzie do niego relative i #footer przyklei Ci się do dołu przeglądarki ...

dzięki za odp. zaraz biorę się za porządki Big Grin
Odpowiedz
#4
poprawiłem:

Kod:
<div id="container">
    <div id="header">
        <div id="head">
            <div class="col_6">
                xxxxxxxx
            </div>
            <div class="col_6">
                <a href="#howtouse" class="nav-button">How to Use</span></a>
                <a href="#examples" class="nav-button">Examples</span></a>
                <a href="#credits" class="nav-button">Credits</span></a>
            </div>
        </div>
    </div>
    
    <div id="middle">
        <div class="slide" id="howtouse">
        xxxxx
        </div>
        
        <div class="slide" id="examples">
        xxxxx
        </div>
        
        <div class="slide" id="credits">
        xxxxx
    </div>
    <div id="footer">
        <div id="footer-img"></div>
        <div id="footer-text"></div>
    </div>
</div>

CSS:

Kod:
html, body {
    background: url(../img/back.png) repeat;
    background-attachment: fixed;
    font-family: Arial, Helvetica, Verdana, sans-serif;
    color: #fff;
    margin: 0;
    padding: 0;
    height: 100%;
}

#container {
  min-height:100%;
  position:relative;
}

#header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    background: #3D3D3D;
    border-bottom: dotted 1px #000;
    padding: 5px;
    height: 100px;
}

#head {
    width: 990px;
    margin-left: auto;
    margin-right: auto;
}

.nav-button {
    padding: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 12px;
}

.current, a.nav-button:hover {
    color: #000;
}

#middle {
    color: #000;
}

.slide {
    margin: 0 auto;
    text-align: justify;
    width: 990px;
    padding: 130px;
    height: 500px;
}

#footer {
    margin: 0 auto;
      position:absolute;
  bottom:0;
    width: 100%;
    height: 65px;
}

#footer-img {
    background: url(../img/zabek.png) repeat-x;
    height: 5px;
}

#footer-text {
    widht: 990px;
    margin-left: auto;
    margin-right: auto;    
    height: 60px;
    background-color: #3D3D3D;
}

jednak dalej jest problem z footerem. jest pośrodku strony, nie na dole. jest na to jakiś sposób, żeby trzymał się dołu? ;]
Odpowiedz
#5
Odpowiedz


Podobne wątki…
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  Fluid layout i problem ze stopką Mtk 5 3,195 21-09-2012, 02:54
Ostatni post: kornell
  Pomocy uciekła mi stopka jaka1977 7 4,149 30-08-2012, 00:16
Ostatni post: jaka1977
  prblem ze stopką insomniac_krk 3 2,313 11-03-2012, 02:08
Ostatni post: kornell
  Stopka rafciorb 2 2,324 13-04-2011, 20:28
Ostatni post: Pedro84
  stópka ucieka rafalg80 3 3,721 28-01-2011, 01:36
Ostatni post: KondzioEtc

Skocz do:


Użytkownicy przeglądający ten wątek:
Sponsorzy i przyjaciele
SeoHost.pl