2 replies [Last post]
erikober
Offline
newbie
Last seen: 12 years 36 weeks ago
Joined: 2006-05-25
Posts: 4
Points: 0

Hello.

Hopefully this is easy,

Here is the page displaying:

<body>
  <div id="wrapper">
      <div id="header"><p>303.555.5555 &bull; </p></div>
      <div id="contentwrapper"><p>LoremIpsumjisddf<br />
        LoremIpsumjisddf<br />
        LoremIpsumjisddf<br />
        </p>
    </div>  
    <div id="footer">
      <p>LoremIpsumjisddf<br />
        LoremIpsumjisddf<br />
        LoremIpsumjisddf<br />
      LoremIpsumjisddf<br />
      </p>
      </div>
  </div>
</body>

and the css:

body, div, img, form, table, tbody, tfoot, thead, tr, td, h1, h2, h3, h4, h5, h6, {
	margin: 0px;
	padding: 0px;
	border:0px none;
}
body {
	background-color: #382e63;
	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	padding-top: 89px;
}
#wrapper {width: 770px;
	Position: relative;
	background-color:#382e63;
	margin: 0px auto;
	padding: 89px 0px 0px 0px;
	text-align: center;
}
#header {
	margin: 0px;
	padding: 0px;
	background-color: #DDDDDD;
}
#contentwrapper {
	margin: 0px;
	padding: 0px;
	background-color: #ffffff;
}
#footer {
	margin: 0px;
	padding: 0px;
	position: relative;
	background-color: #DDDDDD;
}

http://www.upperhouse.us/csstest/index.html

What's causing the break between the divs? I want them to be flush. Still wrapping my head around the basics and any help is much appreciated.

Thanks.

erikober
Offline
newbie
Last seen: 12 years 36 weeks ago
Joined: 2006-05-25
Posts: 4
Points: 0

[Solved] newbie ? - getting rid of spaces between divs

Found the answer for anyone else:

body, div, img, form, table, tbody, tfoot, thead, tr, td, h1, h2, h3, h4, h5, h6, p{
	margin: 0px;
	padding: 0px;
	border:0px none;
}

Adding "p" to set margin of paragraph to 0 fixed it.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 7 weeks 3 days ago
Joined: 2004-06-30
Posts: 9674
Points: 810

[Solved] newbie ? - getting rid of spaces between divs

To clairfy

<div>s, like <span>s, are epty elements that are simply used to group elements. They have no inherent margins, badding, default font size, styles, anything like that.

Paragraph tags, by default, have top and bottom margins, which differs across browsers.

But you figured that out Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies