PDA

View Full Version : divs automatically being added to my code


nofx1728
02-17-2006, 03:24 AM
I'm building this site http://home.bellsouth.net/p/pwp-nofx1728 . I have the layout basically how I want it. The problem I'm having is within my #maincontent table cell. I'm trying to create a unordered list, but Dreamweaver keeps automatically centering the text, when I click the left align tool, it removes the bullet and places my text within a div. This is a table within a table so it looks like this <body> <table> <tr> <td> <table> <tr> <td#maincontent> <div> <ul> <div>. The code you see on that site is not correct, because bellsouth adds frames. I'm just using that link as a tester. I had to add the embedded table because my #cornerbar and #sidebar would get collapsed by #maincontent if they were all in the same table.

1. Does anyone know why <div> are being added to my code without me placing them in there?
2. Does anyone know how to fix this - so I can use unordered lists, and have them left aligned?
3. Also, if you view the attached code you will see the javascript code that was created within dreamweaver for my onrollover events with my menu. Is there a way that I can attach that code from an outside file - like I did with my css file - so I don't have to add all the code to everyone of my pages?

Thanks,

nofx1728




<!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>
<link href="main.css" rel="stylesheet" type="text/css" />
<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>
<style type="text/css">
<!--
.style2 {color: #FFFFFF}
-->
</style>
</head>

<body onload="MM_preloadImages('images/main_home_over.gif','images/main_firm_over.gif','images/main_services_over.gif','images/main_information_over.gif','images/main_contact_over.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" id="header"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="50">
<param name="movie" value="celeste_banner.swf" />
<param name="quality" value="high" />
<param name="scale" value="noborder" />
<embed src="celeste_banner.swf" quality="high" scale="noborder"pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="50"></embed>
</object></td>
</tr>
<tr>
<td colspan="3" class="gradientBackground"></td>
</tr>
<tr>
<td colspan="3"><div align="center">celeste_logo2.gif</div></td>
</tr>
<tr>
<td colspan="3" class="gradientBackground"></td>
</tr>
<tr>
<td colspan="3" id="menu">images/main_home.gif (#)images/main_firm.gif (#)images/main_services.gif (#)images/main_information.gif (#)images/main_contact.gif (#)</td>
</tr>
<tr>
<td width="221" id="cornerbar"></td>
<td colspan="2">images/transparent.gif</td>
</tr>
<tr>
<td width="221" id="sidebar">

</p>
<h1>Welcome:</h1>


About Us (#)</p>


Community Envolvment (#) </p>


</p>


</p>


conference_table.jpg</p></td>
<td width="45">images/transparent.gif</td>
<td width="533"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" id="maincontent"><div align="center">


group_picture.jpg</p>
<h1 align="left">Celeste &amp; Associates, P.A.</h1>
<p align="left">The Law Offices of Celeste &amp; Associates, P.A. concentrate heavily in the litigation of the following types of personal injury claims:</p>



<ul>

<div align="left">All types of personal injury and wrongful death cases arising out of motor vehicle accidents, slip and falls, dog bites and products liability.</div>


<div align="left">Employment cases involving wrongful termination and hostile work environments due to all forms of discrimination as well as workers compensation retaliation claims and wage and overtime claims.</div>


<div align="left">Workers Compensation claims involving any dispute over wage loss or medical benefits.</div>


<div align="left">Social Security Disability claims</div>

[/list]
<blockquote>
<p align="left"></p>
</blockquote>
</div></td>

</tr>
<tr>
<td>

Suite 315

580 Village Boulevard

W. Palm Beach, FL 33409

Tel: 561-478-2447

Fax: 561-478-5073 </p>
</td>
<td>

Suite400

8000 S. U.S. Hwy One

Port St. Lucie, FL 34952

Tel:772-343-8992

Fax:772-343-8993</p>
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" class="gradientBackground"></td>
</tr>
<tr>
<td colspan="3" id="footer">

Celeste &amp; Associates, P.A.

If you would like more information please contact us (#).

</p>
</td>
</tr>
</table>
</body>
</html>

html, body, ul, ol, li, h1, h2, h3, h4, h5, h6, form, fieldset {
margin: 0;
padding: 0;
border: 0;
}

body {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
background-color: #FFFFFF;
margin: 0px;
padding: 0px;
}
.gradientBackground {
background-image: url(gradient_rectangle.jpg);
background-repeat: no-repeat;
margin: 0px;
padding: 0px;
width: 100%;
background-color: #25408f;
}


#mainTable {
line-height: 1.5em;
}

#mainTable td {
padding: 0px;
margin: 0px;
}

#maincontent {
font-size: 14px;
font-size: 100%;

}

#logo {
background-color: #FFFFFF;
background-image: url(celeste_logo1.gif);
background-repeat: no-repeat;
}

#menu {
background-color: #25408f;
background-image: url(images/main_bg.gif);
background-repeat: repeat-x;
}


#cornerbar {
width: 221px;
height: 31px;
font-size: 85%;
background-image: url(images/corner.gif);
background-repeat: no-repeat;



}

#sidebar {
Width: 221px;
font-size: 85%;
background-image: url(images/side.gif);
background-repeat: repeat-y;
vertical-align: top;
clear: right;
}

#header {
background-color: #25408F;
color: #FFFFFF;
width: 100%;
}

#footer {
background-color: #FFFFFF;
color: #000000;
font-size: 70%;
}

td, p, ul, ol {
font-family: Arial, Helvetica, sans-serif;
}

h1:first-child {margin-top: 0;}
h2:first-child {margin-top: 0;}
h1 { font-size: 160%; }
h2 { font-size: 140%; }

#sidebar a {
padding: 3px;
display: block;
border: 2px ;
text-decoration: none;
line-height: 1em;
width: 150px;
}

#sidebar a:link, #sidebar a:visited {
color: #ffffff;
}

#sidebar a:hover, #sidebar a:active {
color: #fffff;
background-color: #BD7731;
border: 2px solid #ffc907;
}

#sidebar ul {
padding-left: 1em;
margin-left: 1em;
list-style-type: none;
}


#sidebar li {
margin: 0px 0px 6px 0px;
}

#sidebar p {
color:#FFFFFF;
padding-left: .7em;
margin-left: .7em;
font-size: 85%;
}

#sidebar h1 {
color: #ffc907;
padding-left: .5em;
margin-left: .5em;
font-size: 125%;

davidj
02-17-2006, 07:55 AM
regarding point 3 (im at work so just scanning the easy ones)

place all functions in a file and name it whatever.js

then in every page add

<script language="javascript" src="whatever.js"></script>

When adding JS with Dreamweaver remember to move the functions it writes

gmcrone
02-17-2006, 08:50 PM
Regarding the divs being added.

Dreamweaver automatically adds these when your doctype is set to XHTML

Mike...

domedia
02-17-2006, 09:06 PM
And there's currently no benefits of declaring the page as xhtml (as long as IE treats it as html 4 anyways), so use html4.01 transitional or strict.

nofx1728
02-17-2006, 10:49 PM
Thank you very much everyone for your responses. I really appreciate it. You all are awesome.

-nofx1728