Voorm 0 Posted June 7, 2013 Report Share Posted June 7, 2013 Hello.Each time when i resize window i get mess.What i should add in css?And how to make #body to be midle of schreen always?Here's some codes: <div id="body"><div id="manu"></div></div> body{font-family:Comic Sans MS , Arial;text-align:center;background-color:#000000;color:#179161;cursor:help;}#body{width:700px;height:600px;border:2px solid #179161;box-shadow: 30px 20px 35px #4A804E;position:relative;}#manu{width:600px;height:100px;border:2px solid #179161;margin-top:1mm;margin-left:50px;position:relative;} Quote Link to post Share on other sites
niche 141 Posted June 8, 2013 Report Share Posted June 8, 2013 Have you looked at it with your developer tools? Quote Link to post Share on other sites
Voorm 0 Posted June 8, 2013 Author Report Share Posted June 8, 2013 Only 2 develop tools i using,and it's xampp & notepad++And testing always in 4 browisers from localhost.Elastic container is something what i curently can't understand.When i say elastic i say while resizing window or etc to it keep own positions.(i using 1024x768)So,if i change in another size,it change a litlle. Quote Link to post Share on other sites
dsonesuk 921 Posted June 9, 2013 Report Share Posted June 9, 2013 With horizontal alignment you would use margin: 0 auto; on both #body, and #manu #body{width:700px;height:600px;border:2px solid #179161;box-shadow: 30px 20px 35px #4A804E;position:relative;margin: 0 auto; /* added by dsonesuk - centres #body within parent element container(body) */}#manu{width:600px;height:100px;border:2px solid #179161;margin-top:1mm;/*margin-left:50px;*/margin: 0 auto; /* amended by dsonesuk - centres #manu within #body element container */position:relative;} As long as you are not using styling like float, and the target element is a block element and a fixed width is set, these should centre horizontally across the screen. 1 Quote Link to post Share on other sites
Voorm 0 Posted June 9, 2013 Author Report Share Posted June 9, 2013 I tryed it,now is ok.Tnx. Quote Link to post Share on other sites
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.