I need some help. The title says it all. I have a page that has a Suckerfish drop down menu. I need the menu to be in the center of the browser regardless of the resolution of the monitor. Right now, I have it settings in my style to work with a resolution of 1024 by 768. What I want, and I know it's possible, is to have the menu centered to be used on any resolution monitor.
Here is the code for the frontpage.html:
__________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
<html xmlns=" xml:lang="en" >
<head>
<title><?php echo $title_page; ?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="web.css" />
<link rel="Shortcut Icon" href="site_files/pictures/favicon.ico" />
<script>
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace (" over", "");
}
}
}
}
}
window.onload=startList;
</script>
</head>
<body>
<div id="header">
<p>NAVPACMETOCCEN San Diego Operational Home Page</p>
</div>
<div id="info">
<p>This page will be down at 1100 GMT on 20 June 2005. Click <a href="site_files/php/status.html">here</a> for more information.</p>
</div>
<div id="menu">
<ul id="nav">
<li><a href="index.php">Home Page</a></li>
<li>Support
<ul>
<li><a href="site_files/php/a.html">Ship Specific</a></li>
<li><a href="site_files/php/a.html">Unit Specific</a></li>
<li><a href="site_files/php/a.html">Detachment</a></li>
<li><a href="site_files/php/a.html">Mobile Env. Team</a></li>
<li><a href="site_files/php/a.html">Coast Guard</a></li>
</ul>
</li>
<li>Satellite
<ul>
<li><a href="site_files/php/a.html">Infrared</a></li>
<li><a href="site_files/php/a.html">Visual</a></li>
<li><a href="site_files/php/a.html">Water Vapor</a></li>
<li><a href="site_files/php/a.html">Lightning</a></li>
<li><a href="site_files/php/a.html">Analysis</a></li>
</ul>
</li>
<li>Products
<ul>
<li><a href="site_files/php/a.html">Warnings</a></li>
<li><a href="site_files/php/a.html">Forecasts</a></li>
</ul>
</li>
<li>Aviation
<ul>
<li><a href="site_files/php/a.html">Products</a></li>
<li><a href="site_files/php/a.html">Contact Info.</a></li>
<li><a href="site_files/php/a.html">OBS/TAFS</a></li>
<li><a href="site_files/php/a.html">Aviation Links</a></li>
</ul>
</li>
<li><a href="site_files/php/links.html">Links</a></li>
</ul>
</div>
<div id="leftside">
<p class="leftmenu"><a href=" Jobs</a></p>
<p class="leftmenu"><a href=" Fear Act</a></p>
<p class="leftmenu"><a href=" Navy Website</a></p>
<p class="leftmenu"><a href="html/privacy.html">Privacy Policy</a></p>
<p class="leftmenu"><a href="site_files/disclaimer.html">DoD Disclaimer</a></p>
</div>
</body>
</html>
_____________________________________________________________
Here is the style sheet "web.css"
_____________________________________________________________
/* This part tells us how the hyperlinks will be handled by the browsers, and also what the background will be */
a:link { /* This is the link standard color*/
color: #000000; /*black*/
}
a:visited { /* This is the color of an already visited link*/
color: #800080;/*purple*/
}
a:hover {/* This is the color your link will take when you move your mouse over it*/
color: #FF0000;/*red*/
text-decoration: none;
}
a:active {/* This is the color and effect when you physically click on the link*/
color: #008080; /*teal*/
}
a { /*This tells the browser not to underline any links */
text-decoration: none;
}
/* This begins the header and the information notice portion */
#header {
margin: -14px -8px 0px -8px;
padding: 10px;
height: auto;
background: #000060;
}
#header p {
margin: 0;
height: auto;
color: #FFFF1B;
text-align: center;
font: small-caps 24px verdana, san-serif, serif;
}
#info {
margin: -1px -8px 0px -8px;
padding: 1px;
height: auto;
}
#info p {
margin: 0;
height: auto;
color: #0000FF;
background: #FFFFFF;
text-align: center;
font: bold 12px arial, san-serif, serif;
}
/* This ends the header and the information notice portion */
/* This begins the Drop-down menu portion*/
#menu { /* Top-Right-Bottom-Left */
margin: 0 0 0 145px;
padding: 0;
width: auto;
font: small-caps bold 12px verdana, san-serif, serif;
}
ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
}
li { /* all list items */
float: left;
position: relative;
width: 125px;
}
li ul { /* second-level lists */
display: none;
position: absolute;
top: 14px;
left: 0;
}
li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
top: auto;
left: auto;
}
li:hover ul, li.over ul { /* lists nested under hovered list items */
display: block;
}
/* This ends the drop-down menu portion */
/* This begins the left-side menu portion */
#leftside {
margin: 100px 0px 0px -8px;
width: 115px;
color: #000000;
font: small-caps 12px arial, san-serif, serif;
}
.leftmenu {
margin: 5px 0 2px 0;
height: 15px;
background: #DDEEFF;
}
#pkinotice {
margin: 0px 50px 0px 125px;
font: bold 12px arial, san-serif, serif;
}
.pki {
border: 2px solid #FF0000;
_____________________________________________________________
Can anyone help me with the centering issue? Yes, I am aware that it is XHTML version 1.1. The page renders just fine in Firefox, as well as IE 6. If it works in other browsers, great, if not, oh well. I know that this can be done, as the link below centers the Suckerfish menu system no matter the resolution.
Any help is appreciated.
Bryan
Here is the code for the frontpage.html:
__________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "
<html xmlns=" xml:lang="en" >
<head>
<title><?php echo $title_page; ?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="web.css" />
<link rel="Shortcut Icon" href="site_files/pictures/favicon.ico" />
<script>
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes;
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace (" over", "");
}
}
}
}
}
window.onload=startList;
</script>
</head>
<body>
<div id="header">
<p>NAVPACMETOCCEN San Diego Operational Home Page</p>
</div>
<div id="info">
<p>This page will be down at 1100 GMT on 20 June 2005. Click <a href="site_files/php/status.html">here</a> for more information.</p>
</div>
<div id="menu">
<ul id="nav">
<li><a href="index.php">Home Page</a></li>
<li>Support
<ul>
<li><a href="site_files/php/a.html">Ship Specific</a></li>
<li><a href="site_files/php/a.html">Unit Specific</a></li>
<li><a href="site_files/php/a.html">Detachment</a></li>
<li><a href="site_files/php/a.html">Mobile Env. Team</a></li>
<li><a href="site_files/php/a.html">Coast Guard</a></li>
</ul>
</li>
<li>Satellite
<ul>
<li><a href="site_files/php/a.html">Infrared</a></li>
<li><a href="site_files/php/a.html">Visual</a></li>
<li><a href="site_files/php/a.html">Water Vapor</a></li>
<li><a href="site_files/php/a.html">Lightning</a></li>
<li><a href="site_files/php/a.html">Analysis</a></li>
</ul>
</li>
<li>Products
<ul>
<li><a href="site_files/php/a.html">Warnings</a></li>
<li><a href="site_files/php/a.html">Forecasts</a></li>
</ul>
</li>
<li>Aviation
<ul>
<li><a href="site_files/php/a.html">Products</a></li>
<li><a href="site_files/php/a.html">Contact Info.</a></li>
<li><a href="site_files/php/a.html">OBS/TAFS</a></li>
<li><a href="site_files/php/a.html">Aviation Links</a></li>
</ul>
</li>
<li><a href="site_files/php/links.html">Links</a></li>
</ul>
</div>
<div id="leftside">
<p class="leftmenu"><a href=" Jobs</a></p>
<p class="leftmenu"><a href=" Fear Act</a></p>
<p class="leftmenu"><a href=" Navy Website</a></p>
<p class="leftmenu"><a href="html/privacy.html">Privacy Policy</a></p>
<p class="leftmenu"><a href="site_files/disclaimer.html">DoD Disclaimer</a></p>
</div>
</body>
</html>
_____________________________________________________________
Here is the style sheet "web.css"
_____________________________________________________________
/* This part tells us how the hyperlinks will be handled by the browsers, and also what the background will be */
a:link { /* This is the link standard color*/
color: #000000; /*black*/
}
a:visited { /* This is the color of an already visited link*/
color: #800080;/*purple*/
}
a:hover {/* This is the color your link will take when you move your mouse over it*/
color: #FF0000;/*red*/
text-decoration: none;
}
a:active {/* This is the color and effect when you physically click on the link*/
color: #008080; /*teal*/
}
a { /*This tells the browser not to underline any links */
text-decoration: none;
}
/* This begins the header and the information notice portion */
#header {
margin: -14px -8px 0px -8px;
padding: 10px;
height: auto;
background: #000060;
}
#header p {
margin: 0;
height: auto;
color: #FFFF1B;
text-align: center;
font: small-caps 24px verdana, san-serif, serif;
}
#info {
margin: -1px -8px 0px -8px;
padding: 1px;
height: auto;
}
#info p {
margin: 0;
height: auto;
color: #0000FF;
background: #FFFFFF;
text-align: center;
font: bold 12px arial, san-serif, serif;
}
/* This ends the header and the information notice portion */
/* This begins the Drop-down menu portion*/
#menu { /* Top-Right-Bottom-Left */
margin: 0 0 0 145px;
padding: 0;
width: auto;
font: small-caps bold 12px verdana, san-serif, serif;
}
ul { /* all lists */
padding: 0;
margin: 0;
list-style: none;
}
li { /* all list items */
float: left;
position: relative;
width: 125px;
}
li ul { /* second-level lists */
display: none;
position: absolute;
top: 14px;
left: 0;
}
li>ul { /* to override top and left in browsers other than IE, which will position to the top right of the containing li, rather than bottom left */
top: auto;
left: auto;
}
li:hover ul, li.over ul { /* lists nested under hovered list items */
display: block;
}
/* This ends the drop-down menu portion */
/* This begins the left-side menu portion */
#leftside {
margin: 100px 0px 0px -8px;
width: 115px;
color: #000000;
font: small-caps 12px arial, san-serif, serif;
}
.leftmenu {
margin: 5px 0 2px 0;
height: 15px;
background: #DDEEFF;
}
#pkinotice {
margin: 0px 50px 0px 125px;
font: bold 12px arial, san-serif, serif;
}
.pki {
border: 2px solid #FF0000;
_____________________________________________________________
Can anyone help me with the centering issue? Yes, I am aware that it is XHTML version 1.1. The page renders just fine in Firefox, as well as IE 6. If it works in other browsers, great, if not, oh well. I know that this can be done, as the link below centers the Suckerfish menu system no matter the resolution.
Any help is appreciated.
Bryan