Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS] Odstęp miedzy obiektami
david8213
post 26.03.2019, 08:29:53
Post #1





Grupa: Zarejestrowani
Postów: 308
Pomógł: 0
Dołączył: 9.12.2009

Ostrzeżenie: (10%)
X----


Jak się pozbyć odstępu między górną a dolnymi 'tabelami' DIVami ?

  1. <!DOCTYPE html>
  2.  
  3.  
  4. <title>...</title>
  5. </head>
  6.  
  7.  
  8.  
  9.  
  10. #container
  11. {
  12. width: 1200px;
  13. display: block;
  14. margin:0 auto;
  15. }
  16.  
  17. #glowna:after {
  18. content:'';
  19. display:block;
  20. clear:both;
  21.  
  22. }
  23.  
  24. #top1 {
  25. width:1150px;
  26. height: 100px;
  27. background-color:lightblue;
  28. margin-left: 0px;
  29. // padding:2px;
  30. margin-top: 10px;
  31. }
  32.  
  33.  
  34. #table1 {
  35. float:left;
  36. width:5%;
  37. height: 500px;
  38. background-color:lightblue;
  39. margin-left: 0px;
  40. // padding:2px;
  41. margin-top: 25px;
  42. }
  43.  
  44. #table2 {
  45. float:left;
  46. width:20%;
  47. height: 500px;
  48. background-color:lightgreen;
  49. margin-left: 0px;
  50. // padding:2px;
  51. margin-top: 25px;
  52. }
  53.  
  54. #table3 {
  55. float:left;
  56. width:550px;
  57. height: 500px;
  58. background-color:gold;
  59. margin-left: 0px;
  60. // padding:2px;
  61. margin-top: 25px;
  62. }
  63.  
  64. #table4 {
  65. float:left;
  66. width:20%;
  67. height: 500px;
  68. background-color:lightgreen;
  69. margin-left: 0px;
  70. // padding:2px;
  71. margin-top: 25px;
  72. }
  73.  
  74. #table5 {
  75. float:left;
  76. width:5%;
  77. height: 500px;
  78. background-color:lightblue;
  79. margin-left: 0px;
  80. // padding:2px;
  81. margin-top: 25px;
  82.  
  83. }
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91. <div id="container">
  92.  
  93.  
  94. <div id="top1">górny - div</div>
  95.  
  96.  
  97. <div id="glowna">
  98. <div id="table1">pierwszy - div</div>
  99. <div id="table2">drugi - div</div>
  100. <div id="table3">trzeci - div</div>
  101. <div id="table4">czwarty - div</div>
  102. <div id="table5">piąty - div</div>
  103. </div>
  104.  
  105. </div> <!--container end--->
  106.  
  107. </body>
  108.  
  109. </html>


margin-bottom: 0px; w #top1 nie pomaga

Ten post edytował david8213 26.03.2019, 09:08:06
Go to the top of the page
+Quote Post
Evinek
post 26.03.2019, 09:22:45
Post #2





Grupa: Zarejestrowani
Postów: 280
Pomógł: 46
Dołączył: 23.03.2010

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


Prawy przycisk myszy na danym elemencie w przeglądarce, klikasz zbadaj element.
Sprawdzasz CSS, podświetla który element odpowiada za jaki fragment strony. Pobaw się tym.

W table1, table2, ..., table5 masz margin-top: 25px; co jest winowajcą.
https://jsfiddle.net/0wLomgaf/
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 Wersja Lo-Fi Aktualny czas: 26.04.2024 - 22:53