Mysterious Space Appearing Below Table (printed in page.tpl.php), Can't Seem to Get Rid of It

siliconvalley1 - May 16, 2008 - 00:49

This is in reference to my layout on http://telecommutereview.com. You can see the "Register for Free" box and the Adsense ad at the top of the content area. These are blocks inserted in the page.tpl.php and placed inside a table in that file. I can't seem to figure out what is creating the extra space between these two blocks and the content below. I have tried everything I can think of to get rid of the space as I want the content to start as far up on the page as possible. I don't know much about theming tables in .css files as I use tables as minimally as possible, I would appreciate if anyone could help me figure this out. Thanks

Firebug a Firefox extension

nevets - May 16, 2008 - 02:46

Firebug a Firefox extension is your friend for problems like this.

Lets start with the table you have placed around the blocks in the content area. It does not have an id or class, I would suggest giving it an id so we can identify uniquely with css, I am going to use the id 'content-blocks', if you give the table a different id change the css below appropriately.

#content-blocks {
  margin-bottom: 0px;
}

#content-blocks .block {
  margin-bottom: 0px;
}

#content-blocks .block p {
  margin-bottom: 0px;
}

#content h2 {
  margin-top: 0px;
}

The last one may not be needed an may cause a problem as it is overly general (applies to all h2 tags in #content) but there is nothing more specific to key on.

 
 

Drupal is a registered trademark of Dries Buytaert.