how to keep page contents in the middle at all times??

J

J

Essentially what I'm trying to achieve is the following:

I want to create a page which holds a menu that I've already created right
in the middle of the page at all times. It needs to remain in the middle of
the screen even when the page is being resized manually and when users visit
with different screen resolutions.

How can I do this?

can anyone post some html templates which already do this?

Thanks,

J
 
J

J

Thanks for that. However it doesn't seem to work for a simple java menu
which I try and put inside the centre box: It's doesn't attempt to centre
this. Is it possible? my page code is below if this helps.

Thanks,

J
-----------------

<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS Centering: Auto-width Margins</title>
<style type="text/css" media="screen">
@import "general.css"; /* Mostly just text styling. */

body {
margin:50px 0px; padding:0px; /* Need to set body margin and padding to get
consistency between browsers. */
text-align:center; /* Hack for IE5/Win */
}

#Content {
width:500px;
margin:0px auto; /* Right and left margin widths set to "auto" */
text-align:left; /* Counteract to IE5/Win Hack */
padding:15px;
border:1px dashed #333;
}
</style>
<script language="Javascript1.2" src="wmb_menu.js"></script>
<script language="Javascript1.2" src="wmb_def.js"></script>
</head>

<body background="../wood.jpg">
<div id="Content">

<h1>&nbsp;<DIV class='wmbmenubar' id="c_r"></DIV>
<SPAN class='wmbmenupin' id="c_rpin"></SPAN></h1>
</div>

<!-- BlueRobot was here. -->
</body>

</html>


----- Original Message -----
From: "Dylan Parry" <[email protected]>
Newsgroups: alt.html
Sent: Saturday, January 31, 2004 6:31 PM
Subject: Re: how to keep page contents in the middle at all times??
 
D

Dylan Parry

J said:
Thanks for that. However it doesn't seem to work for a simple java menu
which I try and put inside the centre box: It's doesn't attempt to centre
this. Is it possible? my page code is below if this helps.
<snip code />

Looking at your code, you need to have the centred DIV the same width as
the Java applet that you are trying to centre otherwise the applet will be
a bit to the left :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top