[IE & Mozilla] Verschil in background-position

Pagina: 1
Acties:

  • rjsomeone
  • Registratie: Juli 2001
  • Laatst online: 20-11-2023

rjsomeone

a.k.a. Tuslsh

Topicstarter
Als ik de volgende div heb:
<DIV STYLE="background: #FFFFFF; background-repeat: no-repeat; background-attachment: fixed; background-position:center center; background-image: 'back.gif'; position: absolute; overflow: auto; padding:0px; margin: 0px; z-index:1;"></DIV>

En ik bekijk de pagina in IE en in Mozilla, dan zit er een verschil in de positie van het achtergrond plaatje:
IE: Center/Center van de DIV
Mozilla: Center/Center v.d. pagina, ofterwijl het halve plaatje valt weg als ik de div met left en top op een andere plaats zet..

De vraag: Hoe krijg ik dat mozilla de background ook in het midden van de div laat zien ipv het midden vd pagina?

Hier had uw advertentie kunnen staan :).


  • RRX
  • Registratie: Mei 2000
  • Laatst online: 25-08 23:43

RRX

@life-

code:
1
2
3
4
5
background: #FFFFFF; moet iig background-color: #FFFFFF; zijn

background-image: 'back.gif'; moet background-image: url('back.gif');

background-position:center center; kan je wel veranderen in: background-position:center;


misschien dat dat het probleem oplost?
\

mijn T.net systeemspecspagina


  • edie
  • Registratie: Februari 2002
  • Laatst online: 09:44
ligt hier aan:
code:
1
background-attachment: fixed


Quote van het W3C (http://www.w3.org/TR/REC-...f-background-attachment):
If a background image is specified, this property specifies whether it is fixed with regard to the viewport ('fixed') or scrolls along with the document ('scroll').
'fixed to the viewport'.

Mozilla doet het dus goed. IE niet.

Om antwoord te geven op je vraag:
Gebruik
background-attachement: scroll

en zet het div'je vast (position: fixed)

"In America, consumption equals jobs. In these days, banks aren't lending us the money we need to buy the things we don't need to create the jobs we need to pay back the loans we can't afford." - Stephen Colbert