Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Górny margines nie reguje w php
Julek
post
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 5.01.2010

Ostrzeżenie: (0%)
-----


Witam. Zakodowałem sobie szablon w xHTML i działa. Potem zacząłem go przenosić i dzielić na pliki aby ułatwić sobie zmiany w przyszłości, wiedz użyłem kodowania php.Wszystkie fragmenty podzieliłem i w pliku index.php dodałem include do tych plików. Biorę podgląd i co widzę? Jest odstęp 8px. A przecież w stylach podałem margines na 0px. Poniżej pokazuje kod plików index.php, style.css i header.php. Prosił bym o pomoc. Jaki błąd popełniłem?

index.php
  1. <?php
  2. /*---------------------------------------------------+
  3. | Copyright ˆ 2010 Kowalski (Julek) Kevin
  4. +----------------------------------------------------+
  5. | Wszystkie pliki są mojego autorstwa, kopiowanie i
  6. |zmiany o informacji autora zabronione lub za zgodą
  7. |autora. GG:2384503
  8. +----------------------------------------------------*/
  9.  
  10.  
  11. include("header.php");
  12. include("side_left.php");
  13.  
  14. echo "<!-- GŁÓWNA KOLUMNA -->
  15. <div id=\"mainContent\">
  16. <div><!-- Najnowsze KLUBY -->
  17. <div id=\"kluby\">Najnowsze kluby</div>
  18. <div id=\"table_text\">
  19. <!-- TREŚĆ DLA PANELU -->
  20. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  21. </div>
  22. </div>
  23. <div>
  24. <!-- Najnowsze UTWORY MUZYCZNE -->
  25. <div id=\"muzyka\">Najnowsze utwory</div>
  26. <div id=\"table_text\">
  27. <!-- TREŚĆ DLA PANELU -->
  28. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  29. </div>
  30. </div>
  31. </div> ";
  32. include("footer.php");
  33. ?>


style.css - fragment kodu
  1. @charset "utf-8";
  2. body {
  3. font-family:Arial, Helvetica, sans-serif;
  4. font-size:11px;
  5. background: #FFFFFF;
  6. margin: 0px auto;
  7. text-align: center;
  8. color: #525252;
  9. position: inherit;
  10. }
  11. #footer_info_text ul {
  12. padding: 0px;
  13. margin: 0px;
  14. }
  15. #footer_info_text li {
  16. background-image:url(images/img_39.gif);
  17. height:17px;
  18. width:100%;
  19. list-style-type: none;
  20. margin: 0px 0px 0px 0px;
  21. font-size:12px;
  22. color:#06456e;
  23. padding-top:10px;
  24. }
  25. #footer_info_text li a {
  26. width:100%;
  27. list-style-type: none;
  28. margin: 0px 0px 0px 0px;
  29. font-size:12px;
  30. color:#06456e;
  31. text-decoration: none;
  32. }
  33. #footer_info_text li img {
  34. vertical-align: middle;
  35. margin: 0px 4px 0px 0px;
  36. }
  37. #footer_info_text li a:hover {
  38. width:100%;
  39. list-style-type: none;
  40. margin: 0px 0px 0px 0px;
  41. font-size:12px;
  42. color:#06456e;
  43. text-decoration: none;
  44. }
  45. #footer_info_text li:hover {
  46. background-image:url(images/img_37.gif);
  47. height:17px;
  48. width:100%;
  49. list-style-type: none;
  50. margin: 0px 0px 0px 0px;
  51. font-size:12px;
  52. color:#06456e;
  53. padding-top:10px
  54. }
  55. #container {
  56. width: 899px;
  57. background: #FFFFFF;
  58. margin: 0 auto;
  59. border: 0px solid;
  60. text-align: left;
  61. color:#525252;
  62. font-family:Arial, Helvetica, sans-serif;
  63. font-size:11px;
  64.  
  65. }


header.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. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Dokument bez tytułu</title>
  6. <link href="style.css" rel="stylesheet" type="text/css" />
  7. </head>
  8.  
  9. <body style="margin:0 auto;">
  10. <!-- STRONA -->
  11. <div id="container">
  12. <!-- TOP -->
  13. <div id="header"></div>
  14. <div id="menu">
  15. <div id="monline">online gości: 65</div>
  16. <div id="menu2">Strona główna</div>
  17. </div>
  18. <div id="menu_link">Strona Główna | Strona Główna | Strona Główna | Strona Główna | </div>
  19. <div id="top_reklama"></div>


Ten post edytował Julek 15.01.2010, 15:46:50
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
AdIoS_Neo
post
Post #2





Grupa: Zarejestrowani
Postów: 159
Pomógł: 43
Dołączył: 8.03.2009

Ostrzeżenie: (0%)
-----


Cytat
  1. <div id=\"table_text\">
2 razy to samo ID ? Tego standardy nie dopuszczają, do takich zadań są CLASS'y.

Cytat
  1. echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><li class="li2"><html xmlns=\"http://www.w3.org/1999/xhtml\"><li class="li1"><head><li class="li2"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /><li class="li1"><title>Dokument bez tytułu</title><li class="li2"><link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\" /><li class="li1"></head><li class="li2"><body style=\"margin:0px auto;\">";<li class="li1">include("header.php");
Tutaj wypisujesz header funkcją echo, a potem znów go wpisujesz do pliku includując go ... Bałagan jakiś masz.

Ten post edytował AdIoS_Neo 15.01.2010, 15:24:10
Go to the top of the page
+Quote Post
Julek
post
Post #3





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 5.01.2010

Ostrzeżenie: (0%)
-----


Nie rozumiem twojej odpowiedzi.. Poprawiłem kod ponieważ ten co wkleiłem był troszkę zły.
Go to the top of the page
+Quote Post
AdIoS_Neo
post
Post #4





Grupa: Zarejestrowani
Postów: 159
Pomógł: 43
Dołączył: 8.03.2009

Ostrzeżenie: (0%)
-----


W głównej kolumnie masz DIV'y i dwa z nich mają to samo ID [table_text], a ID musi być unikalne co znaczy że nie może się powtarzać. Dodaj do CSS taki kod i zobacz co Ci wyjdzie
  1. * { margin: 0px; }
Go to the top of the page
+Quote Post
Julek
post
Post #5





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 5.01.2010

Ostrzeżenie: (0%)
-----


nie stety tak samo.. Przy okazji dzieki za te id (IMG:style_emoticons/default/winksmiley.jpg)

podgląd:
http://www.julek112.yoyo.pl/index.php
http://www.julek112.yoyo.pl/index.html

Może to pomoże.

Ten post edytował Julek 15.01.2010, 21:23:23
Go to the top of the page
+Quote Post
athei
post
Post #6





Grupa: Zarejestrowani
Postów: 389
Pomógł: 141
Dołączył: 11.04.2009

Ostrzeżenie: (0%)
-----


http://validator.w3.org/check?verbose=1&am....pl%2Findex.php
Byte-Order Mark found in UTF-8 File.

Obstawiam że pliki header.php i side_left.php mają złe kodowanie, tzn UTF-8 zamiast UTF-8 bez boom. Otwórz pliki w Notepad++, w prawym dolnym rogu zobacz kodowanie. Konwersja jest w menu 'format'.
Go to the top of the page
+Quote Post
Julek
post
Post #7





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 5.01.2010

Ostrzeżenie: (0%)
-----


działa (IMG:style_emoticons/default/smile.gif) temat można zamknąć.. Oczywiście dla ciebie +
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 16:27