Page 1 sur 1

[CSS] 2 backgrounds.....

Posté : 02 août 2007, 21:28
par chrislabricole
bonjour,

un question bête mais qui pose problème...

Code : Tout sélectionner

#corps { width:80%; margin-left:18%; margin-top: 85px; margin-bottom: 20px; padding-left:4px; padding-right:4px; padding-top:2px; border: 2px solid; border-color:#9558E7; background-color: #118CFF; background-image: url(imgtop.gif); background-repeat: repeat-x; }
voila, mais en bas à droite, je voudrais rajouter une image qui reste fixe de ~100x100px mais... comme il y a déjà un background (imgtop.gif), ça pose problème.. j'ai essayé de rajouter sa pour se que je veut :

Code : Tout sélectionner

background-image: url("imgbottom.gif"); /* Le fond est l'image "imgbottom.gif" */ background-repeat: no-repeat; /* Le fond ne se répète pas */ background-position: top right; /* Le fond est aligné en haut à droite */ background-attachment: fixed; /* Le fond est fixé */
mais évidemment , sa marche pas...
(imgtop.gif ne s'affiche pas)

comment pourrais-je faire ?

Merci de vos réponses :)

Posté : 02 août 2007, 21:54
par Hubert Roksor
Un seul background par élément, mais tu dois pouvoir imbriquer 2 divs pour simuler plusieurs images de fond. Par exemple

Code : Tout sélectionner

<div id="corps"><div id="corps2">...texte...</div></div>
Le tout en assignant ton second bloc de CSS à #corps2.

Posté : 02 août 2007, 23:36
par chrislabricole
oui, sa marche, merci :D


mais il faut le mettre dans toutes les pages... :(