Solved

Centering Page

Posted on 2003-11-17
4
240 Views
Last Modified: 2008-02-26
I have a website done in PHP using div tags.  I want to center the whole page so that if you open it in 1280x680 resolution, etc. the page is in the center of the screen.  I can't use tables because I am pulling a shopping cart into the site.

I have tried several options but it keeps centering the text, picutres & everything.

How can I do this?
0
Comment
Question by:denileigh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 13

Accepted Solution

by:
lozloz earned 63 total points
ID: 9767005
why can't you use tables exactly? all you have to do is put at the top

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center">

and at the bottom you'd have

</td>
</tr>
</table>

then you can pull in your shopping cart as normal?

loz
0
 
LVL 11

Assisted Solution

by:shmert
shmert earned 62 total points
ID: 9767225
You can center the div using CSS, by setting left & right margins to 'auto'.  Or, you can try a percent margin for left and right, which will give you less wasted space on a big screen.

div#content {
    margin: 0 auto;
    - or -
    margin: 0 15%;
}
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL-Design Help 12 67
How to remove  "0":  in a json string 4 46
Do not understand error message 3 46
Windows 10, 64 bit WAMP - won't start 9 30
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question