There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: centering whole website


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
07-Dec-2005, 09:30 PM #1
Solved: centering whole website
How do I center my whole website so that it always appears in the middle of the browser window. I am using Microsoft Publisher to creat the website.
aewarnick's Avatar
Senior Member with 839 posts.
 
Join Date: Sep 2002
07-Dec-2005, 10:09 PM #2
You can use center tags around the entire thing.
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
07-Dec-2005, 11:21 PM #3
when i tried that, the page ended up being way on the right of the screen, also causing a horizontal scrool bar.
lunchbox's Avatar
Senior Member with 167 posts.
 
Join Date: May 2005
Experience: Advanced
07-Dec-2005, 11:24 PM #4
Set margins on the left and right.
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
07-Dec-2005, 11:37 PM #5
im kind of new to html, could you tell me what you mean
lunchbox's Avatar
Senior Member with 167 posts.
 
Join Date: May 2005
Experience: Advanced
08-Dec-2005, 02:18 AM #6
inside the body tag

<body leftmargin="5" rightmargin="5">

</body>
-MaDcOw-'s Avatar
Distinguished Member with 2,165 posts.
 
Join Date: Aug 2005
Location: New Zealand
Experience: Intermediate
08-Dec-2005, 07:11 AM #7
or put a centered table round the whole page.....

<body>
<table align="center" width="100%"><tr><td>
<!-- Page content -->
</td></tr></table>
</body>
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
08-Dec-2005, 05:26 PM #8
its still not working, maybe its something thats already in my html thats not letting it center. how do i post the html, cuz when i just copy and paste, it says its too long.

Last edited by watchintv : 08-Dec-2005 10:43 PM.
xMikex's Avatar
Senior Member with 152 posts.
 
Join Date: Nov 2005
Experience: Intermediate
09-Dec-2005, 12:52 AM #9
Quote:
Originally Posted by watchintv
its still not working, maybe its something thats already in my html thats not letting it center. how do i post the html, cuz when i just copy and paste, it says its too long.
do you have it up on the server now and is the page accesible from the internet right now? If so just link them to the page and they will view the html
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
09-Dec-2005, 01:26 AM #10
i figured it out, i just put it in an iframe and centered the iframe. thanks anyway
ptvGuy's Avatar
Member with 78 posts.
 
Join Date: Apr 2004
Location: Far Northern California
Experience: Advanced
09-Dec-2005, 03:20 AM #11
Inline frames, though a lot of web developers don't like them, do have their uses. However, I wouldn't recommend using one for the sole purpose of centering your page content. Some browsers don't support them. If you're looking for a simple, quick solution, you can place all your page content in a centered table instead.
HTML Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td>PLACE PAGE CONTENT HERE.</td> </tr> </table> </body> </html>
You can set the table width to a specific number of pixels (like the 500 in my example) or as a percentage of the screen size.
__________________
-->ptvGuy (http://www.ptvguy.com/)

KISS (Keep It Simple Stupid)
---------------------------
"It is the express duty of all ampersands to escape. All non-escaped ampersands will be hunted down, deleted, and replaced with escaped ampersands. Have I made myself clear, coder!!!"
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
09-Dec-2005, 06:08 AM #12
ya, your right, thanks for the pointer!
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:37 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.