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 03-04-2007, 04:51 PM weird gap around div
Extreme Talker

Posts: 217
Trades: 0
Since my other topic stopped getting responses...

http://accomputers.org/index.php

See how theres a gap around the gradiant? How do I get rid of that? Iv searched around on google but I cant find the answer anywheres :S

heres the CSS
Code:
body {
    font-family: Arial;
    color: #2c2c2c;
    background: 
url("http://www.accomputers.org/images/bgr.jpg") repeat-y 
center center;
    background-color: #d1d0d1;
}

#container{
    background: 
url("http://www.accomputers.org/images/bg.jpg") repeat-x
center top;
    width: 100%;
    height: 1000px;
}

#content{
    left: 160px;
}
and the html if that matters:
HTML Code:
<div id="container">
    <div id="content">
    <!-- content goes here -->
    </div>
</div>
__________________

Please login or register to view this content. Registration is FREE
Slick Nick is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-04-2007, 04:55 PM Re: weird gap around div
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
Maybe try:
Code:
#container{
    background: 
url("http://www.accomputers.org/images/bg.jpg") repeat-x
center top;
    width: 100%;
    height: 1000px;
    margin: 0 0;
}
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 04:59 PM Re: weird gap around div
pitbull82's Avatar
Super Talker

Posts: 147
Name: Marcin Nabiałek
Location: Poland, Częstochowa
Trades: 0
I don't understand the problem. Where's the gap?

Maybe you mean page padding?

Code:
body
{
    padding: 0;
    margin: 0;
}
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
pitbull82 is offline
Reply With Quote
View Public Profile Visit pitbull82's homepage!
 
Old 03-04-2007, 05:08 PM Re: weird gap around div
Extreme Talker

Posts: 217
Trades: 0
Quote:
Originally Posted by pitbull82 View Post
I don't understand the problem. Where's the gap?

Maybe you mean page padding?

Code:
body
{
    padding: 0;
    margin: 0;
}
yep, that was it thanks a ton
__________________

Please login or register to view this content. Registration is FREE
Slick Nick is offline
Reply With Quote
View Public Profile
 
Old 03-05-2007, 02:59 PM Re: weird gap around div
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
You should ALWAYS start by zeroing out margin and padding on the body and all your main elements -body, h1-h6, a, etc. This levels the playing field - so to speak. Add margin and padding back into your rules as needed.
__________________
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 03-05-2007, 10:14 PM Re: weird gap around div
Extreme Talker

Posts: 217
Trades: 0
Lesson learned
__________________

Please login or register to view this content. Registration is FREE
Slick Nick is offline
Reply With Quote
View Public Profile
 
Old 03-06-2007, 12:39 AM Re: weird gap around div
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
If you want a quick way to do what LNR suggested, put this in your CSS.
Code:
body * {
    margin:  0;
    padding:  0;
}
The good news is that this will work on every element you have.
The bad news is...that...this will work on every element you have (so you'll have to specify with additional rules, as she suggested, after that.)

Looks like you're trying to center that layout. If you are, create a wrapper div like this.

CSS:
Code:
#wrapper {
    margin:  0px auto;  /* This will center it in most browsers */
    width:  width of your layout 
    text-align:  center;  /* this is for IE5 */
}
#wrapper * {
    text-align:  left;  /* counter to the IE5 code above */
}
And in your HTML code:
Code:
<body>
<div id="wrapper">
All your other page code here.
</div>
</body>
Y'all should be at least close after that.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to weird gap around div
 

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