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
Old 09-02-2006, 11:03 PM Top/Footer Space
Novice Talker

Posts: 8
Trades: 0
Hello

I have a layout, (header, body, footer). Between the header and the top of the page there is a little space and the same happens for the footer. How can i delete the space between those images? I set "margin: 0px;" but doesn't work. Why?

Adieu, merci.
Hatsuharu is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-03-2006, 01:37 AM Re: Top/Footer Space
Experienced Talker

Posts: 30
Name: Ben Henick
Trades: 0
Your question would be much easier to answer if we could see a style example, but...

All browsers set a default margin (or in the case of Opera, padding) on the body of the document. In order to resolve your issue, you'll want to set those values to zero.

That would be my first guess at a solution.
persist1 is offline
Reply With Quote
View Public Profile
 
Old 09-03-2006, 08:49 AM Re: Top/Footer Space
Novice Talker

Posts: 8
Trades: 0
Quote:
Originally Posted by persist1 View Post
Your question would be much easier to answer if we could see a style example, but...

All browsers set a default margin (or in the case of Opera, padding) on the body of the document. In order to resolve your issue, you'll want to set those values to zero.

That would be my first guess at a solution.

Hi ^^

Here is my css code. I was trying setting with padding-left: 0px; and padding-top: 0px; at the #container, but didn't work. I thought that margin: 0px; was enough to remove the default margin. Thanks.


Code:
#container{
background-color: #fff;
color: #fff;
font-family: verdana;
font-size: 10px;
margin: 0px;
background: #000 url(body.jpg) repeat-y;
}

.top /*726x324*/{
width: 726px;
height: 324px;
margin: 0px; 
float: center;
background-image:url('top.jpg');
background-repeat: no-repaet;
}

.fbody /*726x121*/{
width: 726px;
height: 121px;
margin: 0px;
float: center;
background: url('body.jpg');
}

.footer /*726*86*/{
width: 726px;
height: 86px;
margin: 0px;
float: center;
background-image: url('footer.jpg');
background-repeat: no-repeat;
}
Hatsuharu is offline
Reply With Quote
View Public Profile
 
Old 09-03-2006, 11:18 AM Re: Top/Footer Space
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You want the following:

body{
margin: 0;
padding: 0;
}
That will zero out all the spaces.

Oh.. and there is no 'float: center' - it's either float: left or float: right; . If you want to center the layout, put a width on your container, and use margin: 0 auto;. In your body (for IE), add text-align: center; , then you'll have to use text-align: left in the container to put all your text back on the left where it belongs inside the container.
__________________
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; 09-03-2006 at 11:21 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 09-03-2006, 02:20 PM Re: Top/Footer Space
Novice Talker

Posts: 8
Trades: 0
Quote:
Originally Posted by LadynRed View Post
You want the following:

body{
margin: 0;
padding: 0;
}
That will zero out all the spaces.
You were right, thanks. One thing, if margin:0; is inside body{...}, is not necessary to have it on the others class right?

Quote:
Originally Posted by LadynRed View Post
Oh.. and there is no 'float: center'..
Holy cow x_x, i didn't know that, now i know why wasn't working, thanks for the tips, now my layout is set to center ^^.

Merci Beaucoup, Adieu.
Hatsuharu is offline
Reply With Quote
View Public Profile
 
Old 09-03-2006, 04:12 PM Re: Top/Footer Space
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Quote:
One thing, if margin:0; is inside body{...}, is not necessary to have it on the others class right?
No. Zeroing out the margins on the body itself just zeros out the defaults for <body>. On any other elements you'll have to do the same zeroing out initially. You could just do something like this:

body, ul, h1, h2, hx... , p, a{
margin: 0;
padding: 0;
}
That zeros out all those elements to start with, then you set margins and padding by id or class where you want them.
__________________
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 09-04-2006, 11:20 PM Re: Top/Footer Space
Novice Talker

Posts: 8
Trades: 0
Quote:
Originally Posted by LadynRed View Post
No. Zeroing out the margins on the body itself just zeros out the defaults for <body>. On any other elements you'll have to do the same zeroing out initially. You could just do something like this:

body, ul, h1, h2, hx... , p, a{
margin: 0;
padding: 0;
}
That zeros out all those elements to start with, then you set margins and padding by id or class where you want them.
Ok. I got it. Thank you so mucho for your help ^^
Merci Beaucoup
Hatsuharu is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Top/Footer Space
 

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.25306 seconds with 12 queries