Jump to content

Can't render a background image


BelowZero

Recommended Posts

I'm trying to apply a background image to a nested <div>. The result is as expected in IE9, but nothing is rendered in Safari 5.1.2 or Firefox 3.6.27. Haven't tried it in any other browser.

The html is just this. I want to place a background image in "layer2" :

 

<div id="layer1">

<div id="layer2">

	<div id="layer3">

	...some code	

	</div> <!--layer3-->

	<div id="layer4">

                             ...more code  

	</div> <!--layer4-->			
</div> <!--layer2--> 
</div> <!--layer1-->

 

Here is the css:

#layer2		{
	padding:10px 20px 10px;
	background:url('http://www.tonalproductions.net/test/images/YCC Header.png') left top repeat-x repeat-y;
	border: 3px solid;
	border-color: #ffffff;	
}

I've tried it with a background color and a .jpg file but nothing gets rendered. Although IE9 shows it just the way I want it.

Any ideas? Thanks.

Link to comment
Share on other sites

Now that we know where your background image is I ran your code. Here's a problem "repeat-x repeat-y " does not work! Use one or the other, if you need to use both the code is simply repeat.

 

Here's your CSS with border combined:

#layer2
{
padding:10px 20px 10px;
background: url('http://www.tonalproductions.net/test/images/YCCHeader.png') left top repeat;
border: 3px solid #ffffff;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.