![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 13 Pomógł: 0 Dołączył: 23.08.2012 Ostrzeżenie: (0%) ![]() ![]() |
Witam,
Mam pytanie, czy jest to normalne zachowanie, że element parent (#a) dziedziczy od children (#(IMG:style_emoticons/default/cool.gif) margines górny? #a { background-color: #900; height: 900px; width: 100%; } #b { height: 400px; width: 70%; margin-right: auto; margin-left: auto; background-color: #969; margin-top: 120px; } </style> </head> <body> <div id="a"> <div id="b">Content for id "d" Goes Here</div> </div> Teraz, zamiast marginesu dla #b, #a ma margines. Nie mogę znaleźć info na ten temat, proszę o podpowiedź. Dzięki. |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 292 Pomógł: 89 Dołączył: 27.12.2006 Skąd: Warszawa Ostrzeżenie: (0%) ![]() ![]() |
To jest wlasnie, tak jak kolega toffiak napisal, margin collapsing. Zadaj rodzicowi margines wiekszy niz 120px i wtedy sie "skolapsuja" (IMG:style_emoticons/default/wink.gif)
Tutaj jest to dosc jasno wyjasnione: http://www.howtocreate.co.uk/tutorials/css/margincollapsing - zwlaszcza czesc o "Nested margins" |
|
|
![]() ![]() |
![]() |
Aktualny czas: 10.10.2025 - 15:07 |