hedgehog90 Posted November 22, 2009 Share Posted November 22, 2009 Hi, I'm not so great with php/css, but I am learning very fast. I've got a problem right now that is driving me crazy. Check out this page of my website: http://www.gpstudios.com/playgame.php?gameid=213 What I'm trying to do is center the game content, but it just won't budge. It's stuck to the left with glue, without anthing i can see doing so. I noticed that when I removed the width parameters on the big black box, it center aligned, however, within this big black box is a center aligned black background that needs to set a width, so I can't use this. here is the css code in question: I have indented it to show which divs go into which. .playpage{ clear:both; position:relative; top:10px; } .ninjapart{ float:left; width:948px; text-align:center; } .ninja_top{ width:800px; } .ninja_md{ width:800px; background:#000000; text-align:center; padding:20px 0px 20px 0px; } .ninja_btm{ width:800px; } <div class="playpage"> <div class="ninjapart"> <div class="ninja_top"><img src="images/footimg_topbg.gif" alt="" /></div> <?php include("displaymedia.php"); ?> <div class="ninja_btm"><img src="images/footimg_btmbg.gif" alt="" /></div> </div> and then the rest of the page.... ninjapart is the entire black box ninja top is the top graphic, ninja md is the black background and the game content, ninja btm is the bottom graphic. I'm a dab hand at the functions/codey side of php, but not so good when it comes to arranging the content on pages with css. Thanks in advance for the help Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted November 22, 2009 Share Posted November 22, 2009 that looks aligned to me? could you take a screenshot and highlight the area that you are on about? Quote Link to comment Share on other sites More sharing options...
hedgehog90 Posted November 23, 2009 Author Share Posted November 23, 2009 Damn, I forgot to add that I have indented it as a temporary fix. No body replied to an earlier post for ages, so i had to do something as it is a live website. I want to put a 160x600 ad on the left of the box, and at the moment if i try it just goes right above it. the black box is stuck there with superglue! Once I know I how to center this, then I can place the add to the left of it. Ignore that though. I just want to center it. Quote Link to comment Share on other sites More sharing options...
FaT3oYCG Posted November 23, 2009 Share Posted November 23, 2009 ill take a look in a bit for you to see what is happening, thanks for clearing that up. but where exactly is this add supposed to be, inside the black containing area or to the left, do you want the game content centered and then the add inside the black box or what as i do not see where it would fit? Quote Link to comment Share on other sites More sharing options...
haku Posted November 24, 2009 Share Posted November 24, 2009 You can center .ninjapart by removing the float and the margin, setting a width of 800px, and then setting left and right margins to auto. 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.