PDA

View Full Version : NavBar Alignment in Dreamweaver


Cool121Fire
08-27-2008, 10:58 AM
Hi,

I have a simple question. I have created a navbar in Fireworks 8 and have then imported into Dreamweaver 8 via Insert --> Fireworks HTML. Everything works fine, except for the fact that I wanted the navbar to be centered horizontally. Straightforward, but for the fact when one of the buttons on the navbar is pressed, the navbar re-aligns itself to the left. I have tried several "center" align options, but none seem to work. Am I missing something?

Corrosive
08-27-2008, 11:17 AM
Hi,

I have a simple question. I have created a navbar in Fireworks 8 and have then imported into Dreamweaver 8 via Insert --> Fireworks HTML. Everything works fine, except for the fact that I wanted the navbar to be centered horizontally. Straightforward, but for the fact when one of the buttons on the navbar is pressed, the navbar re-aligns itself to the left. I have tried several "center" align options, but none seem to work. Am I missing something?

have you got an example online or can you post your code?

Cool121Fire
08-27-2008, 01:06 PM
Code as below:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
td img {display: block;}td img {display: block;}
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('images/home_f2.gif','images/home_f3.gif','images/immigration_f2.gif','images/immigration_f3.gif','images/conveyancing_f2.gif','images/conveyancing_f3.gif','images/litigation_f2.gif','images/litigation_f3.gif','images/family_f2.gif','images/family_f3.gif')">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="navbar.png" fwbase="navbar.gif" fwstyle="Dreamweaver" fwdocid = "680590762" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="25" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="25" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>
<tr>
<td><img name="navbar_r1_c1" src="images/navbar_r1_c1.gif" width="25" height="40" border="0" id="navbar_r1_c1" alt="" /></td>
<td><a href="home.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/home_f2.gif',1);" onclick="MM_swapImage('home','','images/home_f3.gif',1);"><img name="home" src="images/home.gif" width="150" height="40" border="0" id="home" alt="" /></a></td>
<td><a href="immigration.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('immigration','','images/immigration_f2.gif',1);" onclick="MM_swapImage('immigration','','images/immigration_f3.gif',1);"><img name="immigration" src="images/immigration.gif" width="150" height="40" border="0" id="immigration" alt="" /></a></td>
<td><a href="conveyancing.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('conveyancing','','images/conveyancing_f2.gif',1);" onclick="MM_swapImage('conveyancing','','images/conveyancing_f3.gif',1);"><img name="conveyancing" src="images/conveyancing.gif" width="150" height="40" border="0" id="conveyancing" alt="" /></a></td>
<td><a href="litigation.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('litigation','','images/litigation_f2.gif',1);" onclick="MM_swapImage('litigation','','images/litigation_f3.gif',1);"><img name="litigation" src="images/litigation.gif" width="150" height="40" border="0" id="litigation" alt="" /></a></td>
<td><a href="family.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('family','','images/family_f2.gif',1);" onclick="MM_swapImage('family','','images/family_f3.gif',1);"><img name="family" src="images/family.gif" width="150" height="40" border="0" id="family" alt="" /></a></td>
<td><img name="navbar_r1_c7" src="images/navbar_r1_c7.gif" width="25" height="40" border="0" id="navbar_r1_c7" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="40" border="0" alt="" /></td>
</tr>
</table>
</body>
</html>

davidj
08-27-2008, 01:43 PM
code tags please when posting code

Corrosive
08-28-2008, 06:49 AM
Code as below:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
td img {display: block;}td img {display: block;}
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('images/home_f2.gif','images/home_f3.gif','images/immigration_f2.gif','images/immigration_f3.gif','images/conveyancing_f2.gif','images/conveyancing_f3.gif','images/litigation_f2.gif','images/litigation_f3.gif','images/family_f2.gif','images/family_f3.gif')">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="navbar.png" fwbase="navbar.gif" fwstyle="Dreamweaver" fwdocid = "680590762" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="25" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="150" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="25" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>
<tr>
<td><img name="navbar_r1_c1" src="images/navbar_r1_c1.gif" width="25" height="40" border="0" id="navbar_r1_c1" alt="" /></td>
<td><a href="home.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('home','','images/home_f2.gif',1);" onclick="MM_swapImage('home','','images/home_f3.gif',1);"><img name="home" src="images/home.gif" width="150" height="40" border="0" id="home" alt="" /></a></td>
<td><a href="immigration.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('immigration','','images/immigration_f2.gif',1);" onclick="MM_swapImage('immigration','','images/immigration_f3.gif',1);"><img name="immigration" src="images/immigration.gif" width="150" height="40" border="0" id="immigration" alt="" /></a></td>
<td><a href="conveyancing.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('conveyancing','','images/conveyancing_f2.gif',1);" onclick="MM_swapImage('conveyancing','','images/conveyancing_f3.gif',1);"><img name="conveyancing" src="images/conveyancing.gif" width="150" height="40" border="0" id="conveyancing" alt="" /></a></td>
<td><a href="litigation.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('litigation','','images/litigation_f2.gif',1);" onclick="MM_swapImage('litigation','','images/litigation_f3.gif',1);"><img name="litigation" src="images/litigation.gif" width="150" height="40" border="0" id="litigation" alt="" /></a></td>
<td><a href="family.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('family','','images/family_f2.gif',1);" onclick="MM_swapImage('family','','images/family_f3.gif',1);"><img name="family" src="images/family.gif" width="150" height="40" border="0" id="family" alt="" /></a></td>
<td><img name="navbar_r1_c7" src="images/navbar_r1_c7.gif" width="25" height="40" border="0" id="navbar_r1_c7" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="40" border="0" alt="" /></td>
</tr>
</table>
</body>
</html>


Have you tried setting a bigger height on your 'shudder' table to see what that does?

Cool121Fire
08-28-2008, 10:13 PM
Thanks, but it appears the problem was with the export options - need to ensure that there are no spacers in nested tables!