This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > March 2007 > CSS not showing background-image





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author CSS not showing background-image
fletch

2007-03-06, 6:22 pm

I'm having a problem with my background image in DIVs.
here is my code:

CSS:
#HeaderDiv
{

}

#HeaderDivTopLeft
{
background: #020167 url(images/banner_top_left.jpg) no-repeat fixed
left top;
width: 73px;
height: 79px;
}

#HeaderDivTopRight
{
background: #020167 url(images/banner_top_left.jpg) no-repeat fixed
left top;
height: 79px;
width: 73px;
}

HTML
<html>
<head><link rel="stylesheet" type="text/css" href="master.css" /></
head>
<body>
<div id='HeaderDiv'>
<div id='HeaderDivTopLeft' > </div>
<div id='HeaderDivTopRight'> </div>
</div>
</body>
</html>

my problem is the background-image for the HeaderDivTopRight won't
display, and cause it is a copy and paste of the line frm
HeaderDivTopLeft, I'm really confused.

Thanks in advance

Bergamot

2007-03-06, 6:22 pm

fletch wrote:
> I'm having a problem with my background image in DIVs.
> here is my code:


Post a URL, not code.

--
Berg
Jukka K. Korpela

2007-03-06, 6:22 pm

Scripsit fletch:

> I'm having a problem with my background image in DIVs.
> here is my code:


The usual answer to people who post a question about a specific page without
including its address (URL) is something like this: Sorry, we've run out of
crystal balls. Post the URL if you want some help.

This time the problem is simple enough and I'm excessively
overphilanthropic, so I took the trouble of constructing a test case and
noticed:

> background: #020167 url(images/banner_top_left.jpg) no-repeat fixed


It's the "fixed" keyword. It makes the background image fixed with respect
to the viewport (basically, browser window). So it probably happens to
appear inside the element in the first <div> but not later on the page. Just
removing "fixed" should fix this. Probably. Hard to tell without a URL
(hint, hint) how you really want the background image to appear.

P.S. It's useful to post the URL when asking about a problem with a web
page.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Did you know that web pages can be referred to with URLs?

dorayme

2007-03-06, 10:16 pm

In article <zZkHh.10270$lD3.3807@reader1.news.saunalahti.fi>,
"Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote:

> This time the problem is simple enough and I'm excessively
> overphilanthropic


You can no more be this than a tall building can be taller than
it is.

--
dorayme
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews