Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Remove Space Between DIVs
Old 08-07-2008, 02:08 PM [SOLVED] Remove Space Between DIVs
midwestkel's Avatar
Novice Talker

Posts: 12
Name: Kelly Karnetsky
Location: Dayton, OH & Colorado Springs, CO
Trades: 0
I am having an issue with space between DIVs Here is the link to the site and below is the code. Thanks.

http://www.kellysportfolio.com/fups/..._template.html

CSS CODE
Code:
@charset "utf-8";
body {
 font: 100% Verdana, Arial, Helvetica, sans-serif;
 margin: 0; 
 padding: 0;
 text-align: center; 
 color: #000000;
 background-image:url(../images/bgr.jpg);
 background-repeat:repeat-x;
 background-position:top;
 background-color:#579448;
}
.oneCol #container {
 width: 850px; 
 margin: 0 auto; 
 text-align: left;
}
.oneCol #header {
 padding: 0; 
 margin: 0;
}
.oneCol #header img {
 display: block;
}
.oneCol #header h1 {
 margin: 0;
 padding: 10px 0; 
}
.oneCol #mainContent {
 padding: 0 20px; 
 background: #FFFFFF;
}
.oneCol #menu {
 padding: 0 10px; 
 background:#DDDDDD;
 margin: 0;
}
.oneCol #flash {
 padding: 0;
 background:#FFFFFF;
}
.oneCol #footer {
 padding: 0 10px; 
 background:#DDDDDD;
}
.oneCol #footer p {
 margin: 0; 
 padding: 10px 0; 
}
HTML CODE
Code:
<!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=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="css/template_css.css" />
</head>
<body class="oneCol">
<div id="container">
  <div id="header">
    <img src="http://www.webmaster-talk.com/images/logo.png" alt="Oliver Manufacturing" />
  </div>
  <div id="menu">
    <p>MENU</p>
  </div>
  <div id="flash">
    <p>FLASH</p>
  </div>
 
  <div id="mainContent">
    <h1> Main Content </h1>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.</p>
    <h2>H2 Blah Blah </h2>
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.</p>
   </div>
 
  <div id="footer">
    <p>Footer</p>
  </div>
 
</div>
</body>
</html>
__________________
Kelly Karnetsky

Last edited by midwestkel; 08-07-2008 at 02:23 PM.. Reason: Change title.
midwestkel is offline
Reply With Quote
View Public Profile Visit midwestkel's homepage!
 
 
Register now for full access!
Old 08-07-2008, 02:12 PM Re: Remove Space Between DIVs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Zero out the default margins and padding on the <p> tags.
You're also going to need to put a 1px of top padding on #mainContent to close up the space there created by the margin-collapse (which is not a bug).
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 08-07-2008 at 02:14 PM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 08-07-2008, 02:22 PM Re: Remove Space Between DIVs
midwestkel's Avatar
Novice Talker

Posts: 12
Name: Kelly Karnetsky
Location: Dayton, OH & Colorado Springs, CO
Trades: 0
@LadynRed

Thanks, that worked! You are awesome!
__________________
Kelly Karnetsky
midwestkel is offline
Reply With Quote
View Public Profile Visit midwestkel's homepage!
 
Old 08-07-2008, 02:42 PM Re: Remove Space Between DIVs
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Thanks - and you're welcome
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-14-2012, 03:03 AM Re: Remove Space Between DIVs
Junior Talker

Posts: 1
Trades: 0
I second that! Thank you - was struggling with that same problem for very long…..
LadySaint is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Remove Space Between DIVs
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24376 seconds with 12 queries