Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z nadaniem koloru tła nadrzednemu divowi
Forum PHP.pl > Forum > Po stronie przeglądarki > CSS
Sm0q
Więc tak, mam sobie taki kod html:
  1. <link rel="stylesheet" href="style/angels.css" type="text/css" />
  2. </head>
  3. <div id="main">
  4. <div id="top-image">
  5. <div id="menu">
  6. </div>
  7. </div>
  8. <h1>Niusy</h1>
  9. <div id="content">
  10. <div style="margin-top:15px;width:100%;text-align:center;font:9px Verdana;">
  11. <a href="http://korn19.ch/coding/utf8-cutenews/" title="CuteNews - PHP News Management System">
  12. </a>
  13. </div>
  14. <!-- UTF-8 CuteNews: <a href="http://korn19.ch/coding/utf8-cutenews/" target="_blank">http://korn19.ch/coding/utf8-cutenews/</a> -->
  15. </div>
  16. <div id="wrap_right">
  17. <div id="lately" style="text-align:center;">
  18. </div>
  19. <div class="buttons">
  20. </div>
  21. </div>
  22. </div>
  23. </body>


I taki kod CSS:

  1. #top-image {
  2. position: relative;
  3. height: 320px;
  4.  
  5. background: url(../img/top.jpg) center top no-repeat;
  6. text-align: center;
  7.  
  8. background-color: gray;
  9. }
  10.  
  11. #main {
  12. width: 1004px;
  13. margin: auto;
  14. background-color: gray;
  15. }
  16.  
  17. #menu {
  18. position: absolute;
  19. left: 30px;
  20. top: 210px;
  21. width: 251px;
  22. height: 82px;
  23. }
  24.  
  25. #content {
  26. width: 550px;
  27. float: left;
  28. }
  29.  
  30. #lately {
  31. float: right;
  32. width: 250px;
  33. border: 2px solid #B4BA9A;
  34. margin-bottom: 20px;
  35.  
  36. }
  37. #lately a {
  38. font-size: 14px;
  39. }
  40.  
  41. #wrap_right
  42. {
  43. overflow: none;
  44. float: right;
  45. width: 250px;
  46. background-color: white;
  47. }
  48.  
  49. #foot {
  50. background-color: black;
  51. height: 70px;
  52. clear: both;sie od gory do dolu)
  53. text-align: center;
  54. padding-top: 30px;
  55. color: white;
  56. font-size: 24px;
  57. }



I teraz, ustawiajac kolor tla/obrazek tla/obramowanie dla #main chcialbym aby na calej stronie (w sensie od gory do dolu) zostaly zmienione te ustawienia, niestety, zmiana koloru konczy sie w miejscu w ktorym zaczyn aie #content. Jaka jest tego przyczyna?
lukasz_os
Nadaj dla #main overflow:hidden.
Sm0q
Dzieki, caly czas myslalem, ze overflow ma nieco inna funkcje O_o.
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-2025 Invision Power Services, Inc.