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
display background image that expands with text
Old 03-01-2009, 12:35 AM display background image that expands with text
Skilled Talker

Posts: 55
Name: Adrian
Trades: 0
Hi,

I am having trouble getting a background image to be displayed in my main div content container. This is to create a background color. I have the main content container and inside of that container I have 3 other containers. These are the leftContent div, middleContent div and rightContent div. I want to have the background color to be visible throughout the 3 containers so I have placed it in the mainContent container.

CSS Code:

#mainContent {
background-image: url(bg.jpg);
background-repeat: repeat-y;
background-color: #35281E;
width: 915px;
height: 500px; *** only works with height for me? ***
}


#leftContent {
width:167px;
background-color:#E7E7E7;
float:left;
padding: 10px;
}

#middleContent {
float:left;
padding: 15px;
width: 417px;
}

rightContent {
float:right;
padding: 15px;
width:250px;
border-left-width: 1px;
border-left-style: solid;
border-left-color: #E7E7E7;
}

html code:

<div id="mainContent">

<div id="leftContent"> </div>
<div id="middleContent"> </div>
<div id="rightContent"> <div>

</div>


Can someone please advise if I have the css correct for the mainContent div as the only way I can get the image to display is by placing a height value into the mainContent div. This makes the page a certain height and when I add text into the middleContent container the text moves down but the background image is fixed to a certain height. However, I want this image to move downwards with additional text instead of been fixed to a certain height. Any help is appreciated.

regards,
elv8.
elv8 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-01-2009, 08:01 AM Re: display background image that expands with text
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Clear your floats
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-01-2009, 07:10 PM Re: display background image that expands with text
Skilled Talker

Posts: 55
Name: Adrian
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Hi chrishirst, I have cleared the floats on all the 3 div containers but what happens is all 3 div containers now are placed below each other down the page. I have looked at the links you sent me but still am confused with the code and still doesnt work.

The background image does expand downwards in the main div container but the problem is the 3 div containers are meant to be positioned in a 3 column layout but instead are layered down without the float been used in the 3 divs. The main div container is only used to display a backgroud image for the embedded 3 div containers.

Is there a way to display this accross the page rather then down the page?
elv8 is offline
Reply With Quote
View Public Profile
 
Old 03-01-2009, 07:14 PM Re: display background image that expands with text
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
URL needed so we can see what the problems are.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-02-2009, 04:26 AM Re: display background image that expands with text
lightspeed's Avatar
Junior Talker

Posts: 3
Trades: 0
Seems odd that it's not displaying.

Have you tried:

min-height: 500px;
__________________

Please login or register to view this content. Registration is FREE
- Design, Develop, Deliver

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
lightspeed is offline
Reply With Quote
View Public Profile Visit lightspeed's homepage!
 
Old 03-02-2009, 05:09 AM Re: display background image that expands with text
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by lightspeed View Post
Seems odd that it's not displaying.
Not really odd,

If the floats aren't cleared properly, the element has nothing to contain so it will collapse.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-02-2009, 01:13 PM Re: display background image that expands with text
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
And min-height will NOT be supported in IE6.
__________________
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 display background image that expands with text
 

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