Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [css]Problem z wyśrodkowaniem
defox
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 21.02.2008

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


Witam. Mam problem z wyśrodkowaniem strony o kodzie zamieszczonym poniżej.
Główną częścią strony jest "Tabela_01" więc do niej dodałem informacje o marginesach. Dodanie tego do ciała dokumentu również nic nie zmienia. Proszę o pomoc.

  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. <title>Bez nazwy 1</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
  6.  
  7. <style type="text/css">
  8. <!--
  9.  
  10.  
  11.  
  12. #Tabela_01 {
  13. position:absolute;
  14. left:0px;
  15. top:0px;
  16. width:760px;
  17. height:800px;
  18. margin-left: auto;
  19. margin-right: auto;
  20. }
  21.  
  22. #Bez-nazwy-1-01_ {
  23. position:absolute;
  24. left:0px;
  25. top:0px;
  26. width:760px;
  27. height:550px;
  28. }
  29.  
  30. #Bez-nazwy-1-02_ {
  31. position:absolute;
  32. left:0px;
  33. top:550px;
  34. width:760px;
  35. height:250px;
  36. }
  37.  
  38. -->
  39. </style>
  40.  
  41. </head>
  42. <body style="background-color:#FFFFFF;">
  43.  
  44. <div id="Tabela_01">
  45. <div id="Bez-nazwy-1-01_">
  46.  
  47. </div>
  48. <div id="Bez-nazwy-1-02_">
  49.  
  50. </div>
  51. </div>
  52.  
  53. </body>
  54. </html>


Ten post edytował defox 21.02.2008, 17:04:51
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 7)
mokry
post
Post #2





Grupa: Zarejestrowani
Postów: 374
Pomógł: 23
Dołączył: 3.06.2006
Skąd: Katowice

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


  1. #Tabela_01 {
  2. width:760px;
  3. height:800px;
  4. margin: 0 auto;
  5. }


Nie nadawaj pozycji absolute dla conatinerów wewnętrznych.

Ten post edytował mokry 21.02.2008, 17:06:41


--------------------
Pomogłem? Podziękuj proszę klikając poniżej "POMÓGŁ" ;)
Go to the top of the page
+Quote Post
defox
post
Post #3





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 21.02.2008

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


To też nie działa.

Edit; czyli mam nie nadawać żadnych atrybutów position?

Ten post edytował defox 21.02.2008, 17:09:17
Go to the top of the page
+Quote Post
mokry
post
Post #4





Grupa: Zarejestrowani
Postów: 374
Pomógł: 23
Dołączył: 3.06.2006
Skąd: Katowice

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


  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. <title>Bez nazwy 1</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
  5.  
  6. <style type="text/css">
  7. <!--
  8.  
  9.  
  10.  
  11. #Tabela_01 {
  12. width:760px;
  13. height:800px;
  14. margin: 0 auto;
  15. }
  16.  
  17. #Bez-nazwy-1-01 {
  18. width:760px;
  19. height:550px;
  20. }
  21.  
  22. #Bez-nazwy-1-02 {
  23. width:760px;
  24. height:250px;
  25. }
  26.  
  27. -->
  28.  
  29. </head>
  30. <body style="background-color:#FFFFFF;">
  31.  
  32. <div id="Tabela_01">
  33. <div id="Bez-nazwy-1-01">
  34.  
  35. </div>
  36. <div id="Bez-nazwy-1-02">
  37.  
  38. </div>
  39. </div>
  40.  
  41. </body>
  42. </html>


--------------------
Pomogłem? Podziękuj proszę klikając poniżej "POMÓGŁ" ;)
Go to the top of the page
+Quote Post
specialplan
post
Post #5





Grupa: Zarejestrowani
Postów: 206
Pomógł: 21
Dołączył: 1.09.2006
Skąd: Edinburgh

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


  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. <title>Bez nazwy 1</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250" />
  5.  
  6. <style type="text/css">
  7. <!--
  8.  
  9.  
  10.  
  11. #Tabela_01 {
  12. width:760px;
  13. height:800px;
  14. margin-left: auto;
  15. margin-right: auto;
  16. border: 1px solid red;
  17. }
  18.  
  19. #Bez-nazwy-1-01_ {
  20. width:760px;
  21. height:550px;
  22. }
  23.  
  24. #Bez-nazwy-1-02_ {
  25. position:absolute;
  26. left:0px;
  27. top:550px;
  28. width:760px;
  29. height:250px;
  30. }
  31.  
  32. -->
  33.  
  34. </head>
  35. <body style="background-color:#FFFFFF;">
  36.  
  37. <div id="Tabela_01">
  38. <div id="Bez-nazwy-1-01_">
  39. tralalala
  40. </div>
  41. <div id="Bez-nazwy-1-02_">
  42.  
  43. </div>
  44. </div>
  45.  
  46. </body>
  47. </html>


Ten border to tak dla picu, by bylo widac, ze jest na srodku:)

edit: Mokry napisal w tym samym czasie:)

Ten post edytował specialplan 21.02.2008, 17:11:22
Go to the top of the page
+Quote Post
defox
post
Post #6





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 21.02.2008

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


Ok dzieki ;D

edit: jednak u mnie cos nie działa;/ Teraz strona jest w lewym marginesie, gdy usunę "position" wszystko się rozjeżdza tzn, jest ulozone pod sobą, w lewym marginesie. Kod do wglądu.
  1. <title>Bez nazwy 1</title>
  2. <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
  3. <!-- ImageReady Styles (Bez nazwy 1.psd) -->
  4. <style type="text/css">
  5. <!--
  6.  
  7.  
  8.  
  9. #Tabela_01 {
  10.  
  11. width:760px;
  12. height:800px;
  13. left: 0px;
  14. top: 0px;
  15. margin: 0 auto;
  16.  
  17.  
  18.  
  19. }
  20.  
  21. #Bez-nazwy-1-01 {
  22. left:0px;
  23. top:0px;
  24. width:760px;
  25. height:171px;
  26. background-image: url(images/Bez-nazwy-1_01.jpg);
  27. position: absolute;
  28. }
  29.  
  30. #Bez-nazwy-1-02 {
  31. position:absolute;
  32. left:0px;
  33. top:171px;
  34. width:760px;
  35. height:8px;
  36. background-image: url(images/Bez-nazwy-1_02.jpg);
  37. }
  38.  
  39. #Bez-nazwy-1-03 {
  40. position:absolute;
  41. left:0px;
  42. top:179px;
  43. width:70px;
  44. height:43px;
  45. background-image: url(images/Bez-nazwy-1_03.jpg);
  46. }
  47.  
  48. #Bez-nazwy-1-04 {
  49. position:absolute;
  50. left:70px;
  51. top:179px;
  52. width:108px;
  53. height:35px;
  54. background-image: url(images/Bez-nazwy-1_04.jpg);
  55.  
  56. }
  57.  
  58. #Bez-nazwy-1-05 {
  59. position:absolute;
  60. left:178px;
  61. top:179px;
  62. width:12px;
  63. height:43px;
  64. background-image: url(images/Bez-nazwy-1_05.jpg);
  65. }
  66.  
  67. #Bez-nazwy-1-06 {
  68. position:absolute;
  69. left:190px;
  70. top:179px;
  71. width:58px;
  72. height:35px;
  73. background-image: url(images/Bez-nazwy-1_06.jpg);
  74.  
  75. }
  76.  
  77. #Bez-nazwy-1-07 {
  78. position:absolute;
  79. left:248px;
  80. top:179px;
  81. width:17px;
  82. height:43px;
  83. background-image: url(images/Bez-nazwy-1_07.jpg);
  84. }
  85.  
  86. #Bez-nazwy-1-08 {
  87. position:absolute;
  88. left:265px;
  89. top:179px;
  90. width:89px;
  91. height:35px;
  92. background-image: url(images/Bez-nazwy-1_08.jpg);
  93. }
  94.  
  95.  
  96.  
  97. -->
  98. <!-- End ImageReady Styles -->
  99. </head>
  100. <body style="background-color:#FFFFFF;">
  101. <div id="Tabela_01">
  102. <div id="Bez-nazwy-1-01"> </div>
  103.  
  104. <div id="Bez-nazwy-1-02"> </div>
  105. <div id="Bez-nazwy-1-03"> </div>
  106. <div id="Bez-nazwy-1-04">
  107. <a href="http://www.onet.pl"><img border="0" style="float:right" src="images\Bez-nazwy-1_04.jpg"></a> </div>
  108. <div id="Bez-nazwy-1-05"> </div>
  109. <div id="Bez-nazwy-1-06">
  110. <a href="o_firmie.html"><img border="0" style="float:right" src="images\Bez-nazwy-1_06.jpg"></a> </div>
  111. <div id="Bez-nazwy-1-07"> </div>
  112. <div id="Bez-nazwy-1-08"> </div>
  113.  
  114. </div>
  115. </body>
  116. </html>


refresh...

Ten post edytował defox 21.02.2008, 17:44:37
Go to the top of the page
+Quote Post
--NEEKE--
post
Post #7





Goście







Kurs CSS sie klania. Czy niemyslales by uzyc czegos takiego jak display? poczytaj a przy okazji polecam float
Go to the top of the page
+Quote Post
defox
post
Post #8





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 21.02.2008

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


próbwałem różnych wartości dla display i nic się nie zmienia... może mi ktoś pomóc?

@refresh

Ten post edytował defox 22.02.2008, 12:04:58
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 19.08.2025 - 17:12