Solved

How to keep the website always in the middle center of browser windows

Posted on 2008-10-01
6
287 Views
Last Modified: 2014-05-26
Hi all,


I make the website with the resolution: 800x600

I want my website always show in the middle center of the browser windows with any resolution (800x600, 1024x 768...).

How can I do that. Hope everyone can help me this problem

Thanks
0
Comment
Question by:sirquykhoa
  • 2
6 Comments
 
LVL 6

Expert Comment

by:RemcovC
ID: 22612669
I have a quick and dirty sollution i use:
<table width=100% border=0>
<tr>
<td align=center>
[your website code]
</td>
</tr>
</table>
0
 

Author Comment

by:sirquykhoa
ID: 22612679
it just for the center.
I want my website always show in the MIDDLE center with any resolution
0
 
LVL 6

Assisted Solution

by:RemcovC
RemcovC earned 125 total points
ID: 22612714
If you mean in the center from left to right and in the center from top to bottom you can use:
<td align=center valign=center>
0
 
LVL 7

Accepted Solution

by:
BurtAnderson earned 125 total points
ID: 22871836
Use nested tables.

One table is set to width=100%, height=100%, no border, no cellpadding, cellspacing etc. It will consist of one cell. With that table, you can set align="center" and valign="middle". That centers the nested table horizontally and vertically using the align and valign attributes of the cell.
<html>
<head>
  <title></title>
</head>
<body bgcolor="#ffffff">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="center" valign="center">
      <table width="250" height="50" border="1" cellspacing="0" cellpadding="0" align="center" bgcolor="#c0c0c0">
        <tr>
          <td align="center" valign="center">
             Here's your floating window.
	 </td>
        </tr>
      </table>
    </td>
   </tr>
</table>
</body>
</html>

Open in new window

0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

829 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