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.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
repeating background / making the div stretch downwards
Old 12-26-2007, 07:46 AM repeating background / making the div stretch downwards
Novice Talker

Posts: 11
Trades: 0
Hi,

I recently went from tables to divs but now I am having a trouble I used to solve with tables.

URL: http://stargazer.netg.se/img/mi2/mi3/

I cant make the white area stretch downwards. I'd like it too look like this:

See how the white parts continues with the content, and stops when the content stops? I want it to work just like that.

My coding however, looks horrible. See how the white part just stops ... in the middle of everything, regardless of the content still continuing downwards.

CAn I fix this, someway?
Saska is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-26-2007, 08:56 AM Re: repeating background / making the div stretch downwards
Average Talker

Posts: 29
Name: Jean
Trades: 0
Hi,

At first sight, i think you could use a 1px repeating-background on the body, containing the left gray column, and white on the other part.
MarvinLeRouge is offline
Reply With Quote
View Public Profile
 
Old 12-26-2007, 10:38 AM Re: repeating background / making the div stretch downwards
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You're using absolute positioning where you don't need to. Remember that absolute positioning removes the element from normal flow and should only be used when you ... well, absolutely need to do so.

All you need to do is to create a 725 x 1 pixel image containing nothing but the white background color and then add this to your CSS:
Code:
body {
     background:  URL(../images/white-background) top center repeat-y #DBD8D1;
     color:  inherit;
}
If you want to, at that point you can then add a div to create that top header background. It will overlap initially, but then you can create a nested div with your white background and away you go. That's a lot easier to do than it sounds, by the way...you'll just have to try it to see what I'm talking about.

You're also right in that your code is a mess. If I were you, I'd look at blowing it up and starting again from scratch. You're all over the map with it.
__________________

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!
 
Old 12-26-2007, 12:21 PM Re: repeating background / making the div stretch downwards
Novice Talker

Posts: 11
Trades: 0
If I create a white bg then the other darker bg disappears.

It sounds complicated, I've no idea how to achieve that

Quote:
Originally Posted by ADAM Web Design View Post
If you want to, at that point you can then add a div to create that top header background. It will overlap initially, but then you can create a nested div with your white background and away you go. That's a lot easier to do than it sounds, by the way...you'll just have to try it to see what I'm talking about.

Quote:
Originally Posted by ADAM Web Design View Post
You're using absolute positioning where you don't need to. Remember that absolute positioning removes the element from normal flow and should only be used when you ... well, absolutely need to do so. /../ You're also right in that your code is a mess. If I were you, I'd look at blowing it up and starting again from scratch. You're all over the map with it.
Like I said I'm new to divs, I don't know any other way, so if I'd start from scratch it'd look the same :/
Saska is offline
Reply With Quote
View Public Profile
 
Old 12-26-2007, 03:28 PM Re: repeating background / making the div stretch downwards
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Think if it as 'layering' with divs. You put the darker background on the body or a 'container' div. Then, inside that, you create another div with the white background.

Something like this:
<div id="container">
<div id="content">
content here
</div> <!-- end content area -->
</div><!-- end wrapper -->

In your CSS:
#container{
width: 800px;
background: #000000;
margin: 0 auto /*centers the fixed width content area */
}

#content{
width: 560px;
background: #fff;
}
__________________
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
 
Reply     « Reply to repeating background / making the div stretch downwards
 

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