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
Fixed div background image
Old 08-14-2008, 06:02 PM Fixed div background image
Experienced Talker

Posts: 46
Name: Brent
Trades: 0
I am having problems with Firefox and IE7 to align a fixed background image to the top left corner of a scrolling text div.

Here is the webpsge in question:
http://bandvlaw.cgsart.com/site2/bratcher.html

Here is my css for that particular div:
Code:
.content {
position: absolute;
margin-top: 130px;
margin-left: 201px;
padding-top: 10px;
padding-right: 5px;
width: 552px;
height: 445px;
overflow: auto;
background-image: url(images/background.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
}
Now this works perfectly in IE6, but not Firefox of IE7. In those, the image is fixed, but the alignment is to the explorer window, not the div. So in average sized screens, you only see the bottom right of the photo.

If i remove the attachment: fixed, Firefox is fine, background sits right and doesn't scroll. Both IE6 & 7 they sit right, and they scroll.

I'm at a loss.


Also, as an added bonus on that same div, in Firefox the text rolls right out below the div, and slightly to the right. Were as IE6 & 7 it doesn't. That div is set to 552px x 445px, which is the exact size of the image. I can't for the life of me figure out why that is either. Same code as above for that div.

Any help is appreciated! Thanks!

Last edited by cruizer; 08-14-2008 at 09:17 PM..
cruizer is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-15-2008, 02:24 PM Re: Fixed div background image
Experienced Talker

Posts: 46
Name: Brent
Trades: 0
Nobody knows how to fix this problem??
cruizer is offline
Reply With Quote
View Public Profile
 
Old 08-15-2008, 03:06 PM Re: Fixed div background image
angele803's Avatar
Perfectly Imperfect

Posts: 1,774
Name: Stephanie
Location: Oklahoma
Trades: 2
I think the problem with the background image is a combination between the absolute positioning of everything, and the margins. I don't see anything on this page that would need to be absolutely positioned. What is happening is the background image is getting hidden behind the margins. If you add "background-position:400px 200px" it will show the background. My pixel calculations aren't correct, you will need to play with those to get them right.
Now the next problem is that when yo do this, the background will scroll in firefox when you scroll the main page (not the div). I think it is because you aren't technically supposed to use a fixed background image on anything but the body???? Maybe someone else has more info on that.
__________________

Please login or register to view this content. Registration is FREE
angele803 is offline
Reply With Quote
View Public Profile
 
Old 08-15-2008, 03:55 PM Re: Fixed div background image
Experienced Talker

Posts: 46
Name: Brent
Trades: 0
Thanks anglele803,

Positioning is something I have problems with, as if i don't "absolute" position it, then the div's don't align right for me. I'll mess around with the background-position and see what happens.

As for FireFox headingoutside the defined div area, it wasn't, added padding and didn't decrease the div size.
cruizer is offline
Reply With Quote
View Public Profile
 
Old 08-15-2008, 04:00 PM Re: Fixed div background image
Experienced Talker

Posts: 46
Name: Brent
Trades: 0
Well, the unfortunate problem is, that it'll work in FF and EI7, but it moves the image in IE6.
cruizer is offline
Reply With Quote
View Public Profile
 
Old 08-15-2008, 04:16 PM Re: Fixed div background image
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
IE6 doesn't support position:fixed at all, so you're not going to make it work there.

I have to agree with Angele - there's nothing in your layout that requires all that positioning.
__________________
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 Fixed div background image
 

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