Solved

Centering Page

Posted on 2003-11-17
4
232 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
echo button 13 47
Button Click 11 26
Link SQL table to Webpage 9 39
mysql left join sentence 7 22
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now