Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [HTML][CSS]Problem z tłem diva.
Forum PHP.pl > Forum > Przedszkole
iVorIus
Hey hi hello.

Mam problem z tłem diva (#blockbody), który znajduje się pod menu (#menu). Div powinien miec takie samo tło jak menu, żeby nie zostawało 'puste,białe' miejsce pomiędzy menu a stopka (#footer).

Jakie jest rozwiązanie problemu :?:

index.php:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <link rel="stylesheet" href="template/style.css" type="text/css" />
  5. <link rel="stylesheet" href="template/jquery.css" type="text/css" />
  6. <link rel="shortcut icon" href="template/images/fav.GIF" />
  7.  
  8. <script type="text/javascript" src="template/js/rounded-corners.js"></script>
  9. <script type="text/javascript" src="template/js/jquery.js"></script>
  10. <script type="text/javascript">
  11. $(document).ready(function(){
  12.  
  13. $(".btn-slide").click(function(){
  14. $("#panel").slideToggle("slow");
  15. $(this).toggleClass("active"); return false;
  16. });
  17.  
  18.  
  19. });
  20. <title>CMS</title>
  21. </head>
  22.  
  23.  
  24. <div id="site">
  25.  
  26. <img id="header" src="template/images/logo.gif" alt="logo" />
  27.  
  28. <div id="headerRounded"></div>
  29. <div id="bodyblock">
  30. <div id="header1">
  31. <?php include_once('includes/login.php'); ?>
  32. </div>
  33.  
  34. <div id="menu">Menu<br />
  35. <a href="?id=home">Home</a><br />
  36. <a href="?id=cosczegoniema">kliknij tutaj</a>
  37. <a href="?id=news">Newsy</a><br />
  38. <a href="?id=register">Rejestracja</a>
  39. </div>
  40.  
  41. <div id="content">
  42. <?php
  43. $id = $_GET['id'];
  44. $url = 'includes/'.$id.'.php';
  45.  
  46. if(isset($id ))
  47. if(file_exists($url))
  48. include_once($url);
  49. else
  50. include_once('includes/error.php');
  51. else
  52. include('includes/home.php');
  53. ?>
  54. </div>
  55. </div>
  56. <div class="clearBoth"></div>
  57. <div id="footer">All&nbsp;rights&nbsp;reserved.&nbsp;&copy;&nbsp;Autor</div>
  58.  
  59. </div>
  60. <script type="text/javascript">
  61. rC = new DHTMLgoodies_roundedCorners();
  62.  
  63. rC.addTarget('site',15,15,'#ffffff','#00aeff',5,false);
  64. rC.addTarget('headerRounded',15,15,'#CC99FF','#FFFFFF',5,false,'top_left,top_right');
  65. rC.addTarget('footer',15,15,'#CC99FF','#FFFFFF',5,false,'bottom_left,bottom_right');
  66. rC.init();
  67. </body>
  68. </html>


style.css:
  1. html, body {
  2. background: #00aeff;
  3. font-family: Arial, Helvetica, sans-serif;
  4. font-size: 12px;
  5. color: #FFFFFF;
  6. }
  7.  
  8. #site {
  9. background-color: #FFFFFF;
  10. width: 860px;
  11. margin: auto;
  12. }
  13.  
  14. #header {
  15. width: 860px;
  16. height: 140px;
  17. }
  18.  
  19. #header1 {
  20. background-color: #CC99FF;
  21. height: 30px;
  22. }
  23.  
  24. #login {
  25. width: 160px;
  26. height: 80px;
  27. z-index: 2;
  28. position: absolute;
  29. left: 900px;
  30. top: 180px;
  31. }
  32.  
  33. #tablelogin {
  34. padding: 4px 2px 0 2px;
  35. }
  36.  
  37. #bodyblock {
  38. background: #CC99FF;
  39. width: 848px;
  40. height: auto;
  41. padding: 0;
  42. }
  43.  
  44. #menu {
  45. background: inherit;
  46. width: 155px;
  47. height: inherit;
  48. padding-left: 5px;
  49. float: left;
  50. }
  51.  
  52. #content {
  53. background: #E7E7E7;
  54. width: 668px;
  55. height: inherit;
  56. color: #434343;
  57. float: right;
  58. padding: 10px;
  59. }
  60.  
  61. .clearBoth { clear:both; }
  62.  
  63. #footer {
  64. background-color: #9999FF;
  65. text-align:center;
  66. }
bogdan89
nie analizowałem kodu, ale wydaję mi się, że overflow:hidden; dla bodyblock, może rozwiązać sprawę.
Moorti
jak takie same to skopiować tło w css z #menu do #bodyblock no i będzie takie same
iVorIus
Wielki Dzięki winksmiley.jpg

Pomogło smile.gif

Pozdrawiam smile.gif).
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.