![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 207 Pomógł: 0 Dołączył: 7.09.2010 Ostrzeżenie: (0%) ![]() ![]() |
centrowanie divóv ,gdy rodzic ma position :fixed;
oto kod html: <div id="top"> <div id="topcont"> <div id="logo"><div id="contlogo"><span>text</span></div></div> <div id="notice"> </div> </div> </div> Chciałbym aby divy logo i notice były wycentrowane,i aby span text był także wycentrowany w pionie i poziomie. Próbowałem zmienić divy logo i notice na float:left.Wszystko ładnie,ale tekst za to nie jest wyśrodkowany:( Proszę o pomysły. div#top{ position:fixed; left:50%; margin-left: -550px; width:1100px; background-color:#000; height:40px; text-align:center; } div#topcont{ display:inline-block; width:900px; height:40px; background-color:#00F; text-align:center; } div#logo{ display:inline-block; text-align: center; width:100px; height:40px; background-color:#0f0; } div#notice{ background-color:#00F; display:inline-block; width:100px; height:40px; text-align: center; } div#logo #contlogo{ display: table; margin:0px; width:100px; height:40px; text-align: center; background-color:#0F3; } span{ display: table-cell; vertical-align: middle; font-size: 15px; } |
|
|
![]() ![]() |
![]() |
Aktualny czas: 2.10.2025 - 18:10 |