Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> div
blizniak
post
Post #1





Grupa: Zarejestrowani
Postów: 253
Pomógł: 0
Dołączył: 14.04.2005

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


witam
mam cos takiego
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>Mój pierwszy layout</title>
  5. <meta http-equiv="Content-Type"
  6. content="text/html; charset=iso-8859-2" />
  7.  
  8. <link rel="stylesheet" type="text/css"
  9. media="all" href="s.css" />
  10.  
  11.  
  12. <style type="text/css">
  13. div#one
  14. {
  15. width: 349px;
  16. height: 140px;
  17. background-color: #103BB8;
  18. margin: 10px;
  19. margin-top: 10px;
  20. padding: 5px;
  21. border: 1px solid;
  22. border-color: #003300;
  23. float: left;
  24. }
  25.  
  26.  
  27. div#two
  28. {
  29. width: 349px;
  30. height: 140px;
  31. background-color: #103BB8;
  32. margin: 10px;
  33. margin-top: 10px;
  34. padding: 5px;
  35. border: 1px solid;
  36. border-color: #003300;
  37. float: left;
  38. }
  39.  
  40. div#trzy
  41. {
  42. width: 349px;
  43. height: 140px;
  44. background-color: #103BB8;
  45. margin: 10px;
  46. margin-top: 10px;
  47. padding: 5px;
  48. border: 1px solid;
  49. border-color: #003300;
  50. float: left;
  51.  
  52. }
  53.  
  54. div#cztery
  55. {
  56. width: 349px;
  57. height: 140px;
  58. background-color: #103BB8;
  59. margin: 10px;
  60. margin-top: 10px;
  61. padding: 5px;
  62. border: 1px solid;
  63. border-color: #003300;
  64. float: left;
  65.  
  66. }
  67.  
  68.  
  69.  
  70.  
  71. </head>
  72.  
  73.  
  74.  
  75. <div>
  76. <div id="one">Teks1t</div>
  77. <div id="two">Tekst2</div>
  78. </div>
  79. <div>
  80. <div id="trzy">Tekst3</div>
  81. <div id="cztery">Tekst4</div>
  82. </div>
  83.  
  84.  
  85. </body>
  86. </html>


jak zrobic zeby byl taki efekt
  1. <TR>
  2. <TD>tekst1</TD>
  3. <TD>tekst2</TD>
  4. </TR>
  5. <TR>
  6. <TD>tekst3</TD>
  7. <TD>tekst4</TD>
  8. </TR>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Sedziwoj
post
Post #2





Grupa: Zarejestrowani
Postów: 793
Pomógł: 32
Dołączył: 23.11.2006
Skąd: Warszawa

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


  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>Mój pierwszy layout</title>
  5. <meta http-equiv="Content-Type"
  6. content="text/html; charset=iso-8859-2" />
  7.  
  8. <link rel="stylesheet" type="text/css"
  9. media="all" href="s.css" />
  10.  
  11.  
  12. <style type="text/css">
  13. div.czysta {
  14. clear : both;
  15. }
  16. div#one
  17. {
  18. width: 349px;
  19. height: 140px;
  20. background-color: #103BB8;
  21. margin: 10px;
  22. margin-top: 10px;
  23. padding: 5px;
  24. border: 1px solid;
  25. border-color: #003300;
  26. float: left;
  27. }
  28.  
  29.  
  30. div#two
  31. {
  32. width: 349px;
  33. height: 140px;
  34. background-color: #103BB8;
  35. margin: 10px;
  36. margin-top: 10px;
  37. padding: 5px;
  38. border: 1px solid;
  39. border-color: #003300;
  40. float: left;
  41. }
  42.  
  43. div#trzy
  44. {
  45. width: 349px;
  46. height: 140px;
  47. background-color: #103BB8;
  48. margin: 10px;
  49. margin-top: 10px;
  50. padding: 5px;
  51. border: 1px solid;
  52. border-color: #003300;
  53. float: left;
  54.  
  55. }
  56.  
  57. div#cztery
  58. {
  59. width: 349px;
  60. height: 140px;
  61. background-color: #103BB8;
  62. margin: 10px;
  63. margin-top: 10px;
  64. padding: 5px;
  65. border: 1px solid;
  66. border-color: #003300;
  67. float: left;
  68.  
  69. }
  70.  
  71.  
  72.  
  73.  
  74. </head>
  75.  
  76.  
  77.  
  78. <div class="czysta">
  79. <div id="one">Teks1t</div>
  80. <div id="two">Tekst2</div>
  81. </div>
  82. <div class="czysta">
  83. <div id="trzy">Tekst3</div>
  84. <div id="cztery">Tekst4</div>
  85. </div>
  86.  
  87.  
  88. </body>
  89. </html>

Słowo wyjaśnienie, clear zapobiega opływaniu elementu z danej strony, tu by wystarczyło tylko left

Ten post edytował Sedziwoj 5.12.2006, 00:48:49
Go to the top of the page
+Quote Post

Posty w temacie


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: 4.10.2025 - 17:31