Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Bootstrap stopka na dole strony 2 kolumny
Forum PHP.pl > Forum > Po stronie przeglądarki > HTML \ XHTML
Lejto
Mam problem ze stopką na dole strony. Wszystko wygląda ok jak oglądamy stronę na ekranie laptopa lub większego monitora. Problem jest dla mniejszych rozdzielczości kiedy kolumny schodzą pod siebie, nie wiem w czym jest błąd. W pliku foortererror pokazuje jak stopka nachodzi na stronę, a w pliku footernormal jest poprawny wynik.


Kod:




  1. <!DOCTYPE html>
  2. <head lang="pl">
  3. <meta charset="UTF-8">
  4. <link rel="stylesheet" href="css/style.css" type="text/css">
  5. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
  6.  
  7. <!-- Optional theme -->
  8. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
  9.  
  10. <!-- Latest compiled and minified JavaScript -->
  11. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
  12. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  13. <script src="jquery.backstretch.js"></script>
  14. </head>
  15. $.backstretch("img/bg.jpg");
  16. h1 {
  17. text-align: center;
  18. font-family: "AvanteGarde";
  19. font-size: 70px;
  20. }
  21. header p{
  22. font-family: "AvanteGarde";
  23. text-align: center;
  24. font-size: 20px;
  25. }
  26. @font-face{
  27. font-family:"AvanteGarde";
  28. src: url('font/font2.ttf');
  29. }
  30. .col-centered{
  31.  
  32. text-align: center;
  33. margin: 0 auto;
  34. }
  35. .footer {
  36. position: absolute;
  37. bottom: 0;
  38. width: 100%;
  39. /* Set the fixed height of the footer here */
  40. height: 60px;
  41. text-align: center;
  42. font-family:"AvanteGarde";
  43. }
  44. .ng{
  45. color: #3a8c03;
  46. font-family: "AvanteGarde";
  47. font-size: 40px;
  48. margin-top: 0;
  49. }
  50. html {
  51. height: 100%;
  52. width: 100%;
  53. min-width: 100%;
  54. min-height: 100%;
  55. position: relative;
  56. }
  57.  
  58. body {
  59. height: 100%;
  60. width: 100%;
  61. padding: 0;
  62. margin: 0;
  63. margin-bottom: 60px;
  64. }
  65.  
  66. .container-fluid{
  67. height:60%;
  68. display:table;
  69. width: 100%;
  70. padding: 0;
  71. }
  72.  
  73. .row-fluid {height: 100%; display:table-cell; vertical-align: middle;}
  74.  
  75. .centering {
  76. float:none;
  77. margin:0 auto;
  78. }
  79. header{
  80. margin-bottom: 2%;
  81. }
  82.  
  83. <header>
  84. <h1><label style="color: #3a8c03"> F.P.H.U </label> <label style="color: #254c0b"> Darmont</label></h1>
  85. <p style="color: #3a8c03">KOMINKI - OCZYSZCZALNIE - DORADZTWO - SERWIS</p>
  86. </header>
  87.  
  88. <div class="container-fluid" style="width: 900px; margin: auto;">
  89. <div class="row-fluid">
  90.  
  91. <div class="col-sm-6 col-centered">
  92. <img src="img/oczyszczalnie.png" class="img-responsive center-block">
  93. <p class="ng">oczyszczalnie</p>
  94. </div>
  95.  
  96. <div class="col-sm-6 col-centered" style="padding-left: 120px">
  97. <img src="img/kominki.png" class="img-responsive center-block">
  98. <p class="ng">kominki</p>
  99. </div>
  100.  
  101. </div>
  102. </div>
  103. <footer class="footer">
  104. <p>Skontaktuj sie z nami i zapytaj o produkty</p>
  105. <p>nr. tel: 924 456 256 e-mail: aaa@sga.com</p>
  106. </footer>
  107. </body>
  108. </html>

janek5
Usuń pozycjonowanie absolutne dla .footer, jest zbędne.

BTW po co ustawiasz na sztywno szerokość, trochę bez sensu rozwiązanie korzystając z grid?
tomek200
  1. .footer {
  2. position: absolute;
  3. bottom: 0;
  4. width: 1000px;
  5. /* Set the fixed height of the footer here */
  6. height: 60px;
  7. text-align: center;
  8. font-family:"AvanteGarde";
  9. }

w linijce width zmieniasz na 1000px i powinno dzialać.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.