Jump to content

Can't center my page


Recommended Posts

Get rid of all the codes in the body style which are mainly an old coding method that you don't need; Try this:-


Untitled Document
<br /><!--<br /><br />body,td,th {<br />    font-family: Verdana, Geneva, sans-serif;<br />    font-size: 14px;<br />    color: #000;<br />    float:auto;<br />}<br />body {<br />    background-color: #000;<br />    margin: 0 auto;<br />}<br />#apDiv1 {<br />    position:relative;/*absolute;*/<br />    visibility:visible;<br />    width:1024px;/*200px;*/<br />    height:625px;/*115px;*/<br />    z-index:1;<br />    margin: 0 auto;<br />    /*left: 0;<br />    top: 0;*/<br />}<br />--><br />


The image in the div is 1024*625 but the div is only 200*115 so the image won't fit. Margin: 0 auto won't work with position: absolute divs, the auto cannot work if the div has a fixed top and left position. The left: 0; is stopping it from centering.

Edited by Wickham
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...