Bonsoir à tous,
Je tente de mettre deux versions d'un background-image, une pour ordi/tablette, la seconde pour smartphone.
J'ai essayé avec
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
<script type="text/javascript" src="js/retina.js"></script>
placé à la fin du body
Et ces CSS :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.at2x(img/fond_index.jpg);
body {
	background-image: url(img/fond_index.jpg);
	background-position: center top;
	background-size: cover;
	background-repeat: no-repeat;
	background-attachment: fixed;
	width: 100%;
	margin: 0px;
	}
	@media all and (-webkit-min-device-pixel-ratio: 1.5) {
  body {
    background-image: url('/img/fond_index@2x.jpg');
 
  }
}
Avec ce code, aucune image apparaît
QQ aurait-il une idée du soucis ? D'autres méthodes citées dans l'intitulé me seraient-elles plus bénéfiques ?
Merci pour votre aide et bonne soirée,
dh