PDA

View Full Version : DW and browser ignoring my div padding


silverglade
03-17-2009, 05:07 PM
hi, DW and IE and firefox are ignoring my padding declaration for the #news_room div. the div gets bigger in DW view, and it ignores my padding in browser, any help greatly appreciated. thanks. derek


here is the css to the page, #news_room is further down.

@charset "utf-8";
/* CSS Document */

#container {
margin: 0 auto 0 auto;
width: 871px;
height: 950px;
}

#header {
margin: 0 auto 0 auto;
width: 871px;
height: 373px;
}

body {
background-color: #1C4386;
}

#home_middle_text {
float: left;
margin-top: 20px;
width: 400px;
height: 250px;
color: #ffffff;
font-family: arial, "lucida console", sans-serif;

}

#home_the_latest {
float: right;
margin-top: 20px;
width: 400px;
height: 250px;
font-family: arial, "lucida console", sans-serif;
color: #ffffff;
font-size: x-large;
border: 2px solid blue;
padding-left: 5px;
padding-right: 5px;
}

#home_the_latest img {
float: right;
border: 4px solid white;
margin:0px 5px 0 5px;
}

#lowerlinks {
margin: 0 auto 0 auto;
width: 871px;
height: 284px;
clear:both;
}

#lowerlinks img {
float: left;
margin-left: 10px;
}

#copyright {
margin: 10px auto 0 auto;
color: #ffffff;
font-size: small;
width: 100%;
height: 25px;
text-align: center;
}

/*************************ABOUT US CODE********************/
#about_us_top {
margin: 0 auto 0 auto;
width: 100%;
height: 500px;
color: #ffffff;
text-align: left;
}

#about_us_top img {
float: right;
border: 3px solid white;
margin-top: 20px;
margin-left: 40px;
}

#about_founder {
margin: 0 auto 0 auto;
width: 100%;
height: 400px;
color: #ffffff;
text-align: left;
}

#about_founder img {
float: right;
border: 3px solid white;
margin-top: 20px;
margin-left: 100px;
}

/****************************NEWS ROOM CODE **********************/

#news_container {
margin: 0 auto 0 auto;
width: 871px;
height: 1100px;
}

#news_room {
float: left;
padding: 20px auto 0 20px;
width: 871px;
height: 450px;
margin-top: 20px;
color: #ffffff;
border: 3px solid white;

}


.img {
float: right;
border: 3px solid white;;
margin-top: 20px;
margin-left: 100px;

}

#news_copyright {
clear:both;
margin: 10px auto 0 auto;
color: #ffffff;
font-size: small;
width: 100%;
height: 25px;
text-align: center;
}

and here is the html for the page

<!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>
<link href="santas_helper.css" rel="stylesheet" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Santas Little Helpers Home</title>
<style type="text/css">a:link {
color: #FFFF00;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFF00;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FFFF00;
}
</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>
<meta name="" content="santas little helper, charity, new jersey, disabled" />
<meta name="Keywords" content="charity, santas little helper" />
</head>

<body onload="MM_preloadImages('slices_on/images/home2.jpg','slices_on/images/about2.jpg','slices_on/images/news2.jpg','slices_on/images/donate2_05.jpg','slices_on/images/volunteering2.jpg','slices_on/images/photos2.jpg','slices_on/images/events2.jpg','slices_on/images/wish_stories2.jpg','slices_on/images/request_wish2.jpg','slices_on/images/contact2.jpg')">


<div id="news_container">

<div id="header"> <img src="slices_off/images/header1.jpg" width="872" height="201"><a href="home.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','slices_on/images/home2.jpg',1)"><img src="slices_off/images/home1.jpg" name="Image3" width="61" height="175" border="0" id="Image3" /></a><a href="about_us.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','slices_on/images/about2.jpg',1)"><img src="slices_off/images/about1.jpg" name="Image4" width="78" height="176" border="0" id="Image4" /></a><a href="news_room.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','slices_on/images/news2.jpg',1)"><img src="slices_off/images/news1.jpg" name="Image5" width="111" height="176" border="0" id="Image5" /></a><a href="donate.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','slices_on/images/donate2_05.jpg',1)"><img src="slices_off/images/donate1.jpg" name="Image6" width="59" height="176" border="0" id="Image6" /></a><a href="volunteering.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','slices_on/images/volunteering2.jpg',1)"><img src="slices_off/images/volunteering1.jpg" name="Image7" width="108" height="176" border="0" id="Image7" /></a><a href="photos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','slices_on/images/photos2.jpg',1)"><img src="slices_off/images/photos1.jpg" name="Image9" width="69" height="176" border="0" id="Image9" /></a><a href="events.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image10','','slices_on/images/events2.jpg',1)"><img src="slices_off/images/events1.jpg" name="Image10" width="69" height="176" border="0" id="Image10" /></a><a href="wish_stories.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image11','','slices_on/images/wish_stories2.jpg',1)"><img src="slices_off/images/wish_stories.jpg" name="Image11" width="103" height="176" border="0" id="Image11" /></a><a href="request_wish.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image12','','slices_on/images/request_wish2.jpg',1)"><img src="slices_off/images/request_wish1.jpg" name="Image12" width="115" height="176" border="0" id="Image12" /></a><a href="contact_us.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image13','','slices_on/images/contact2.jpg',1)"><img src="slices_off/images/contact1.jpg" name="Image13" width="98" height="176" border="0" id="Image13" /></a></div>


<div id="news_room">
<h3>News Room</h3>
<p>December 2008 - Santa's Little Helpers Visits St. Mary's Hospital with their Buddies
from the NY Islanders

Andy Hilbert and Richard Park met
with Santa's Little Helpers
Foundation gift provider, Ray Jackson for the third year in a row at St. Mary’s Hospital in Bayside. They were joined by Mike Hiller. Smith helps donate toys to other children in need.
</p>
<div class="img"><img src="news_room_images/1.jpg" width="326" height="230" /></div>
<p></p></div><!--end newsroom-->



<div id="news_room"><h3>December 2008 - Santa's Little Helpers win Sweetwater Clifton Award</h3>

<p>The New York Knickerbockers have announced Raymond Smith, Jr. as the winner
of the Sweetwater Clifton "City Spirit" Award for the month
of January. The award,
named in honor of Nat &quot;Sweetwater&quot; Clifton, who was the first African-American to play for the Knicks, recognizes those who have made a significant difference in the lives of others. Each month, a winner is chosen by members of the Knicks front office staff and honored at center court of a Knicks game. The winner will receive a $2,000 donation in their name to a charity of their choice from the New York Knicks.
<div id="news_room2">
<p>Lynbrook, NY-native Raymond Smith, Jr., 10, founded Santa's Little Helpers Foundation in September 2005. His mission is bringing cheer to hospitalized children and relieving their anxiety. Since 2003, his efforts have grown to help
sick and underprivileged children by raising more than $250,000 and donating thousands of toys. Raymond visits children in South Nassau <br />
Communities Hospital weekly. Many celebrities and athletes have accompanied Raymond during his visits.</p>
</div>
<p>&nbsp;</p>
<div class="img"><img src="news_room_images/2.jpg" width="326" height="232" /></div>
<p>

<p>&nbsp;</p></div>




<div id="news_room"><p><h3>June 2008 - Santa's Little Helpers volunteers pack up a special delivery</h3><div class="img"><img src="news_room_images/3.jpg" width="326" height="245" /></div>
<p>

<p>Santa's Little Helpers and volunteers pack up a special delivery to his good friend,(NHL hockey player) Janne Niinimaa in Finland. Janne then

distributes all the toys to local orphanges and hospitals, telling all the children of Santa's Little Helpers in America.
<p>

</div> <!--end newsroom-->

<div id="news_room"> <h3>June 2008 - Santa's Little Helpers get
a little help from their friends</h3>

<p>Santa's Little Helpers get help from fellow students at Marion St School, putting together hospital
emergency room gift bags.
The children were thrilled to help out knowing making these bags would make each child in the emergency room feel less anxiety, help distract them from the scary hospital surroundings and help comfort their pain.
<div class="img"><img src="news_room_images/4.jpg" width="326" height="245" /></div>
</p></div>

<div id="news_room"><h3> May 2007 - Santa's Little Helpers Visit Finland</h3><div class="img"><img src="news_room_images/5.jpg" width="326" height="221" /></div>

Little Ray supports six orphanages and two childrens hospitals in Finland, and his NHL buddy Janne Niinimaa delivers them for him. </div>

<div id="news_room"><h3> May 2006 - “One little person making a big difference”</h3> <div class="img"><img src="news_room_images/6.jpg" width="251" height="293" /></div>
<p>Something magical happens when a kid makes a special effort to give a gift to another child who is going through a difficult time in their life. Santa's Little Helpers have been doing this for the past four years. Through this little ten year olds efforts, hospitalized children's spirits are lifted which enhances the healing process.

Thanks to the great support of sponsors like Owner Charles Wang of the NY Islanders, little Ray is able to continue his efforts of making hospitals a less scary place.</div>




<div id="news_copyright"> &copy; <a href="http://derekvanderven.com">Derekvanderven.com</a> website design </div>


</div>
<!-- end container-->
</body>
</html>

silverglade
03-18-2009, 12:25 PM
i found out from someone that is was the "auto" i was using in my padding. it causes the other padding numbers not to work. so dont use auto in the padding. thanks. derek

coloeagle
03-18-2009, 04:59 PM
Well glad you got that worked out.

I will add that if you are going to use the news_room styles several times on the same page you should make it a class and not an id. An id should only be used once per page.