Jump to content

I can't center align this!


hedgehog90

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.