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
Background Image Won't Appear For Some Reason..
Old 03-12-2009, 11:42 AM Background Image Won't Appear For Some Reason..
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Hello.

I'm going to try to lay this out the best way I can because I don't have the site on a domain/server yet. But I wanted the background of the page(s) to be displayed different because it wasn't design standard. First the code looked something like this:

Code:
<html><head><title>...</title>
<style type="text/css">

body{ background-image: url("some url");
         background-repeat: no-repeat;
         background-color: black;
         margin: 0 auto; 
       }

</style></head>
<body>
     whatever....
</body>
</html>
Everything shared the same background I designed in Photoshop, but I wanted to change that because when I resize in IE (Ctrl +), things started to break up.

So that was changed to:

Code:
<html><head><title>...</title>
<style type="text/css">

#bodybackground{ background-image: url("some url");
                          background-repeat: no-repeat;
                          background-color: black;
                          margin: 0 auto; 
                        }

</style></head>
<body>
     <div id="bodybackground">
     whatever....
    </div>
</body>
</html>
The technique worked fine in IE, but now it doesn't display anything in Firefox. So what could be the problem?
LayneMitch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-12-2009, 12:21 PM Re: Background Image Won't Appear For Some Reason..
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It doesn't have a height, so will only be as high as the content. Only IE incorrectly (as usual) treats a background image as content.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I 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-13-2009, 02:38 AM Re: Background Image Won't Appear For Some Reason..
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Quote:
Originally Posted by chrishirst View Post
It doesn't have a height, so will only be as high as the content. Only IE incorrectly (as usual) treats a background image as content.
I thought that the height and width of the containing element was already determined by the content..?..
LayneMitch is offline
Reply With Quote
View Public Profile
 
Old 03-13-2009, 04:39 AM Re: Background Image Won't Appear For Some Reason..
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep, if it has any.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I 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-13-2009, 11:49 AM Re: Background Image Won't Appear For Some Reason..
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Yep, if it has any.
So in other words you're saying that if I have this:

<div id="backgroundimage">
<div id="contentwrapper">
<p>some text and images<p>
</div>
</div>

The reason the #contentwrapper has an established width and height is because it's wrapped around the actual content, but #backgroundimage is wrapped around the containing block so there needs to be a height set for it..right? And also how is it that the width is already determined?

Last edited by LayneMitch; 03-13-2009 at 11:54 AM..
LayneMitch is offline
Reply With Quote
View Public Profile
 
Old 03-13-2009, 10:27 PM Re: Background Image Won't Appear For Some Reason..
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
width on a block element is always 100% of the parent element unless a value is set.

#contentwrapper will be the height of the content inside it
#backgroundimage will be the height of #contentwrapper

if the total height of contentwrapper is NOT more than the height of the background image it will appear to be clipped.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Background Image Won't Appear For Some Reason..
 

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