Forum Moderators: open

Message Too Old, No Replies

How do I centre page in browser

How do I centre page in browser

         

mcg7

2:45 pm on Nov 4, 2003 (gmt 0)



I am looking to have my site sit in the middle of the browser window - 700px * 400px

I have done this before using a frameset - is this still the best way to do it?

I tried using divs and css controls and got it to centre horizontally but I can't seem to get the div to appear in the centre vertically.

Any help would be greatly appreciated.

limbo

3:26 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



MCG7

Welcome to webmasterworld :)

You can align content in centrally using the align="center" attribute.

E.G.

<div align="center">content</div>

or

<table align="center">
<tr>
<td>content</td>
</tr>
</table>

Is this what you wanted? Or did I miss your point?

Ta

Limbo

tedster

1:53 am on Nov 5, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The align attribute works for now, but it is deprecated and headed for the trach bin. There are several approaches -- this topic has come up many times, especially in the CSS forum. A Site Search here, or a Google search like this:
site:webmasterworld.com center page browser window

...will turn up a pile of results. For one good example, see this thread:
[webmasterworld.com...]

divaone

7:37 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



search google for "the noodle incident little boxes" for some layouts including a fully centered box.