473,395 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

unwanted space between div boxes

Hi, I've been looking for answers to this for HOURS. I'm very new to CSS. I've written a code for there to be three columns. a HEADER, MAIN and FOOTER.
I don't want there to be any space between the three of them, yet, I can't seem to figure out how to do this. I've got all my margin's and padding's set to 0. Yet, there's still a space when I view in Firefox.
Here is my css ...
<code>
@charset "utf-8";
body {
background: #666666;
margin: 0;
padding: 0;
text-align: center;
color: #000000;
}
.oneColLiqCtrHdr #container {
width: 100%;
text-align: left;
margin-top: 0px;
padding: 0;
}
.oneColLiqCtrHdr #header {
background: #ffffff;
margin-top: 0px;
padding: 0px;
position: relative;
margin-bottom: 0px;
}
.oneColLiqCtrHdr #mainContent {
padding: 0px;
background: #FFFFFF;
margin-top: 0px;
position: relative;
margin-bottom: 0px;
}
.oneColLiqCtrHdr #footer {
padding: 0px;
background:#FFFFFF;
margin-top: 0px;
position: relative;
margin-bottom: 0px;
}
</code>

Here is my HTML >>

<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>Christopher Jeske</title>
<link href="cssFiles/allpages.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: x-small;
color: #CC66CC;
}
body {
background-color: #D3DC29;
}
a:link {
color: #660033;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #660033;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: underline;
color: #660066;
}
h1 {
font-size: x-large;
}
h2 {
font-size: large;
}
h3 {
font-size: medium;
}
h4 {
font-size: small;
}
-->
</style></head>

<body class="oneColLiqCtrHdr">

<div id="container">
<div id="header">
<h1>This is the header</h1>
<!-- end #header --></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 <a href="http://www.hotmail.com">purus</a>, 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 level heading </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>
<!-- end #mainContent --></div>
<div id="footer">
<p>Footer</p>
<!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html></code>

I just can't figure this out.
Basically I just want my DIV'S to be butted up against each other. This is possible is it not? Can someone help?
I WOULD SO MUCH APPRECIATE IT!!!!
May 30 '07 #1
2 3692
drhowarddrfine
7,435 Expert 4TB
I'm not sure about a couple of things.

First, you have two body stylings in your css.
Second, you say you want three columns with no space but I see three rows with space between them. Do you want rows or columns?

To remove the space between them, in your css, add:
*{
margin:0;
padding:0;
}
May 30 '07 #2
I meant rows not columns.
+ I do have margin's and padding's set to 0 in my CSS >>> I'm still seeing spaces?
May 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Steve K | last post by:
Hi, The site I've just created, when tested on a windows PC has an unwanted white space (about 2-4 pixels high) in between two tables. I would like there to be zero space there. Here is the test...
3
by: Brian | last post by:
I have a page with content, navigation, and footer divs, in that order. The nav div has position: absolute, width 8em, on green background. The other divs have an 8em green left border, such that...
5
by: Geoff Hague | last post by:
(posted to both alt.html and c.i.w.a.s. as I'm not sure what, exactly, is at fault here) I'm doing a site re-design: http://www.captainsoftheworld.com/cotw/index.html...
3
by: Buz | last post by:
I am having a problem with extra, unwanted space showing up on my web form tables. I've tried hand coding and can get the htm file to display fine. But as soon as I bring the form into Visual...
16
by: lovecreatesbeauty | last post by:
/* When should we worry about the unwanted chars in input stream? Can we predicate this kind of behavior and prevent it before debugging and testing? What's the guideline for dealing with it? ...
3
by: et | last post by:
How can I strip out unwanted characters in a string before updating the database? For instance, in names & addresses in our client table, we want only letters and numbers, no punctuation. Is...
1
by: Edward | last post by:
I created a simple CSS layout (code and example below) for bloggin/writing but ran into five issues that I need help with: 1. How do I get rid of the right-margin red line on the last three...
4
by: Magnus Warker | last post by:
Hello group, I am producing a form within a table: <table> <tr> <td> <form> ... </form>
3
by: Joe Stateson | last post by:
I have a template field that contains filenames that are (or can be) on a unix system. The hypen (and others) is a valid filename character in unix. When I display the name of the file I get an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.