It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming CSS Forum

No margin on top and bottom?

No margin on top and bottom?

Postby MM xSkillz on Sun Oct 26, 2008 10:38 pm

Hi,

I'm trying to make the main content block (td class="content") of the following page not have any margin at the top and bottom (so that you can't see the background except on the sides):

https://www.adhalo.com/2_0/

I've tried everything I can think of with margins, paddings, cellpadding, and cellspacing but I can't get it to work. Any suggestions? Thanks!
MM xSkillz
100+ Club
 
Posts: 196
Joined: Fri Mar 16, 2007 5:07 pm

Postby dflynn on Mon Oct 27, 2008 12:05 am

firsty you shouldn't be using tables for layouts.

as for no margins :

<div class="content">

(in the css)
.content{
margin: 0px;
}
will work just fine.
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada

Postby MM xSkillz on Mon Oct 27, 2008 3:08 pm

Yea, I tried that at first. That is why I changed it to a table, because a div will not work and I think that is because all divs come with a line break so it is inserting a line break before and after the div which cannot be removed. Any other suggestions?

(I've changed it back to a div with those specifications so you can see)
MM xSkillz
100+ Club
 
Posts: 196
Joined: Fri Mar 16, 2007 5:07 pm

Postby flabbyrabbit on Tue Oct 28, 2008 1:08 pm

You need to add the margin: 0px; in the body { of the css

Flabby Rabbit
Image
User avatar
flabbyrabbit
500+ Club
 
Posts: 706
Joined: Thu Jan 25, 2007 1:10 pm
Location: Midlands, England

Postby MM xSkillz on Tue Oct 28, 2008 2:54 pm

Cool, it worked, thanks!
MM xSkillz
100+ Club
 
Posts: 196
Joined: Fri Mar 16, 2007 5:07 pm


Who is online

Users browsing this forum: No registered users and 0 guests