Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów
problem ze stopką - Wersja do druku

+- Forum Webmastera, HTML, CSS, PHP, MySQL, Hosting, Domeny - Forum dla Webmasterów (https://www.webmastertalk.pl)
+-- Dział: Technologie internetowe - tworzenie stron WWW (https://www.webmastertalk.pl/forum-technologie-internetowe-tworzenie-stron-www)
+--- Dział: xHTML, CSS, JavaScript (https://www.webmastertalk.pl/forum-xhtml-css-javascript)
+--- Wątek: problem ze stopką (/thread-problem-ze-stopka)



problem ze stopką - rapek - 24-01-2013

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;
}



RE: problem ze stopką - atp - 24-01-2013

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 ...


RE: problem ze stopką - rapek - 25-01-2013

(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


RE: problem ze stopką - rapek - 25-01-2013

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? ;]


RE: problem ze stopką - atp - 25-01-2013