Aller au contenu

background-attachment:scroll ne fonctionne pas sous FF. Problème d'overflow ?


Locace

Sujets conseillés

Bonjour,

J'ai codé, j'ai fouillé et je me tourne maintenant vers vous:

Voici le problème :

Un de mes divs à la propriétés suivantes

	position:absolute;
top:0;
right:0; /** Il y avait une position absolute top0 right0 **/
width:585px;
_width:585px;
height:577px;
padding:0px;
overflow:auto;
text-align:justify;
background-color:white;
background-image:url(http://nova.esthetinet.com/themes/nova/images/dechet_degrade.gif);
background-repeat:no-repeat;
background-position:top right;
background-attachment:scroll;

Le background devrait donc bouger à mesure que je scroll. Cela fonctionne très bien sous IE7 mais pas du tout sous FF.

Voici l'exemple

Je remercie d'avance celui qui m'aidera. Si vous avez eu le même problème et que vous l'avez résolu ou que votre expérience vous montre la faute ce serait super. Je livre le site en fin de semaine et c'est le dernier problème qu'il me reste.

Encore merci d'avance

Lien vers le commentaire
Partager sur d’autres sites

Le problème vient du fait que le W3C dit que le background-attachment:scroll doit faire défiler l'arrière plan avec le document.

Mais le scroll d'une <div> n'est pas le scroll du document !

Une seule directive permettrait cela : background-attachment:local, mais elle fait partie du CSS3 et n'est encore supportée par aucun navigateur.

Internet explorer traite à tort le background-attacment:scroll comme un background-attachment:local.

background-attachment: scroll

The background image scrolls along with the document. Since scrolling a div is not scrolling the document, the background image of my div with overflow: auto shouldn't react.

scroll does not mean: let the image scroll with the element. The value local does this. Nonetheless Explorer Windows interprets scroll as such.

background-attachment: fixed

On elements other than the body, this value does not what one expects. The background image is fixed, not relative to the element but relative to the entire window. To the uninitiated, the effect can be quite startling.

It's best to see the element as a sort of "window" through which you view the background image. If this "window" moves, you see a different part of the background image.

See my example to understand the point.

background-attachment: local

This CSS3 value says the background has to scroll with the element. Currently no browser supports it. I hope support comes soon; we need this value.

Lien vers le commentaire
Partager sur d’autres sites

Veuillez vous connecter pour commenter

Vous pourrez laisser un commentaire après vous êtes connecté.



Connectez-vous maintenant
×
×
  • Créer...