Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [CSS]Wytknięcie błędów
Forum PHP.pl > Forum > Przedszkole
Niedowiarek
Witam, napisałem trochę CSS'a aby wypozycjonować stronę, i chyba robię to źle, bo kod jest taki.. długi. W każdym razie wstawiam tu kod, i proszę o sprawdznie czy jest poprawny, czy całkowicie zły.


  1. body {
  2. font-size: 12;
  3. color: black;
  4. background-image: url(back.png);
  5. background-repeat: repeat;
  6. }
  7.  
  8. #wrap {
  9. margin: 0 auto;
  10. width: 850px;
  11. height: 800px;
  12. background-image: url(wrap.png);
  13. }
  14.  
  15. /* Początek nagłówka */
  16.  
  17. #head_left {
  18. background-image: url(head_left.png);
  19. background-position: left;
  20. background-repeat: no-repeat;
  21. width: 21px;
  22. height: 155px;
  23. float: left;
  24. }
  25.  
  26. #head_center {
  27. background-image: url(head_center.png);
  28. background-repeat: repeat-x;
  29. width: 758px;
  30. height: 155px;
  31. float: left;
  32. position: relative; top: 2px;
  33. }
  34.  
  35. #head_right {
  36. background-image: url(head_right.png);
  37. background-position: left;
  38. background-repeat: no-repeat;
  39. width: 21px;
  40. height: 155px;
  41. float: left;
  42. }
  43.  
  44.  
  45. #header {
  46. width: 800px;
  47. height: 145px;
  48. margin: 0 auto;
  49. position: relative; top: 20px;
  50. }
  51.  
  52. #logo {
  53. background-image: url(logo.png);
  54. width: 372px;
  55. height: 89px;
  56. float: center;
  57. position: relative; left: 30px; top: 40px;
  58. }
  59.  
  60. /* Koniec nagłówka */
  61.  
  62. /* Początek lewego menu */
  63.  
  64. #menu_left {
  65. background-image: url(menu_left.png);
  66. background-position: left;
  67. background-repeat: no-repeat;
  68. width: 20px;
  69. height: 221px;
  70. display: inline;
  71. float: left;
  72. }
  73.  
  74. #menu_center {
  75. background-image: url(menu.png);
  76. background-repeat: repeat-x;
  77. width: 110px;
  78. height: 221px;
  79. float: left;
  80. position: relative; bottom: 3px;
  81. }
  82.  
  83. #menu_right {
  84. background-image: url(menu_right.png);
  85. background-position: right;
  86. background-repeat: no-repeat;
  87. width: 20px;
  88. height: 221px;
  89. float: left;
  90. position: relative; bottom: 5px;
  91. }
  92. #menu {
  93. width: 150px;
  94. height: 210px;
  95. float: left;
  96. display: inline;
  97. position: relative; left: 25px; top: 40px;
  98. }
  99.  
  100. /* Koniec lewego menu */




  1. <title>Empire of Death</title>
  2. <link rel="stylesheet" type="text/css" href="style.css" />
  3. </head>
  4. <div id="wrap">
  5. <div id="header">
  6. <div id="head_left"></div><div id="head_center"><div id="logo"></div></div><div id="head_right"></div>
  7. </div>
  8. <div id="menu">
  9. <div id="menu_left"></div><div id="menu_center"></div><div id="menu_right"></div>
  10. </div>
  11. </div>
  12. </body>
  13. </html>

markonix
Cytat
background-image:
background-position: left;
background-repeat: no-repeat;

->
Kod
background: url(head_left.png) no-repeat left;


pedro84
Pogrupuj selektory.
konole
Nie rozumiem, w jakim celu dodajesz parametr "height". One same ci się rozszerzą w miarę dodawania tekstu.
worek
Hehe może właśnie nie mają mu się rozszerzaćquestionmark.gif Jako przykład podam wmontowanie topki w diva biggrin.gif
Niedowiarek
Po 1. to co powiedział worek
Po 2. Jeżeli nie dam parametru height jak daje obrazek jako background, i w divie nie będzie żadnego tekstu, to nic się nie wyświetla.


Cytat(pedro84)
Pogrupuj selektory.


To znaczy?
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.