Voorm Posted June 7, 2013 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;} Link to comment Share on other sites More sharing options...
niche Posted June 8, 2013 Share Posted June 8, 2013 Have you looked at it with your developer tools? Link to comment Share on other sites More sharing options...
Voorm Posted June 8, 2013 Author 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. Link to comment Share on other sites More sharing options...
dsonesuk Posted June 9, 2013 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 Link to comment Share on other sites More sharing options...
Voorm Posted June 9, 2013 Author Share Posted June 9, 2013 I tryed it,now is ok.Tnx. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now