Wicked nifty HTML/CSS layering problem

Status
Not open for further replies.

CanSpice

Ars Tribunus Angusticlavius
7,147
Here's a sample of what I want to happen: http://test.canspice.org/test.html

This page renders just fine in Mozilla 0.9.9. It doesn't work properly in Opera 5.0.5 or IE6. What I'm going for is to have the two images stick in the top-right and bottom-left corners of the viewing window when the page scrolls. The way it is now is the way it should be done with CSS, as that's how the standards say it should be done. However, as the most widely-used browser doesn't do it right, is there some other way to do this that will work in IE?
 

HitScan

Ars Tribunus Militum
2,523
Subscriptor++
I don't think this bodes well for your near future:
fixed

The fixed value is currently not recognized by any browser.
This is from DevGuru, so if Moz does it it wouldn't be listed. (They just deal with IE and NS, ick.)

That said, it'll be a few months at the earliest before anyone other than Moz users would ever see what you intend. Javascript is your friend. :) (some window. event should suffice, then edit the .top or whatever properties of the divs.)

HitScan
 

CanSpice

Ars Tribunus Angusticlavius
7,147
well can you post some code, but also arent the images going to flash when the user scrolls and that could get annoying pretty fast if they do, but thats just my thoughts on it...

All the code is there. And no, the images shouldn't flash. They should just stay in place while other stuff scrolls over and past them.

The fixed value is currently not recognized by any browser.

Sucky. Except for Mozilla, of course. :)

Using JavaScript is an option, but I'd rather use that as a last resort. JavaScript tends to not work very well when setting layout properties, which leads to things not scrolling very smoothly.

Oh well. *sigh*
 

BNS

Well-known member
95
You seem to be using the wrong properties to get your background image in a fixed position. There are specific properties for backgrounds

W3.org CSS background properties

Specifically 'background-attachment' and 'background-position'

I don't know if IE6 handles them or not though, I haven't tried them.

The moral of this story - always read the specs.
 

BNS

Well-known member
95
Well, I've been having a bash at it and now realise why you're using divs - you need two backgrounds.

Oh well, this works for one:

Code:
body {
  margin:0 90px;
  background-image: url(/html//civis/threads/ukirt.gif);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: top right;
}

Moral of this story - understand the problem before supplying an answer
 
Status
Not open for further replies.