ziedinjsh Posted September 21, 2010 Report Share Posted September 21, 2010 Svaiki! Ir tāda lieta - Šis ir div css. viņam vajadzētu būt pielipušam pie browsera augšas un apakšas. Tā arī ir, bet es nekādīgi viņu nevar iecentrēt lapas vidū!! left:50% right:50% nestrādā.. tad man div atrodas labajā pusē! Varbūt kāds var palīdžet? Paldies jau iepriekš! :) .warp{ width:1000px; margin-left:auto; margin-right:auto; background-image:url(images/body.png); background-repeat:repeat-y; position:fixed; bottom: 0px; top:0px; } Quote Link to comment Share on other sites More sharing options...
vitao.web Posted September 21, 2010 Report Share Posted September 21, 2010 nu es parasti daru ta: margin: 0px auto 0px auto; un viss Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 21, 2010 Author Report Share Posted September 21, 2010 es arī, bet tas strādā ja nav position:fixed; bet ja nav position:fixed; tad atkal viņš nav pielipis pie augšas un apakšas! Quote Link to comment Share on other sites More sharing options...
edi Posted September 21, 2010 Report Share Posted September 21, 2010 man liekas ka ja ieraksta ieks body margin: auto tad bus centra Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 21, 2010 Author Report Share Posted September 21, 2010 nav gan :p Quote Link to comment Share on other sites More sharing options...
labaiss Posted September 21, 2010 Report Share Posted September 21, 2010 (edited) Jā man ir bījušas līdzīgas problēmas, nemācēšu paskaidrot. Pamēģini ielikt varbūt iekš vēl viena div taga ar margin: 0 auto 0 auto; varbūt nostrādā. Tu vēlies panākt kaut ko līdzīgu kā sticky footer? Edited September 21, 2010 by labaiss Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 21, 2010 Report Share Posted September 21, 2010 CSS centrējums skanētu aptuveni šādi: #divid { position: fixed; margin: 0px auto; } Quote Link to comment Share on other sites More sharing options...
Vhubuo Posted September 22, 2010 Report Share Posted September 22, 2010 (edited) Ja es pareizi sapratu, tad pareiza atbilde bus - pozicionejiet arejo divu ar fixed, un iekšejo ar margin. Kaut ka ta: <style> body{ margin:0; padding:0; } #bottom { border:1px solid black; position:fixed; bottom: 0px; top:0px; width:100%; height:100px; } #wrap{ width:1000px; background-color:black; height:40px; margin: 0 auto; margin-top: 20px; } </style> <body> <div id="bottom"> <div id="wrap"> </div> </div> </body> Edited September 22, 2010 by Vhubuo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.