body { background-image: url("NomeFile.png"); background-repeat: no-repeat; background-position: center; background-attachment: fixed; }
La proprietà background-image è una funzione che permette di impostare come sfondo, una immagine che abbiamo scaricato da Internet. Quest’ultima, se troppo piccola, viene ripetuta fino a riempire tutto lo schermo. Quindi, se non si vuole questa caratteristica, possiamo inserire la linea “background-repeat: no-repeat”. Inoltre, possiamo definirne anche la posizione con “background-position: center”, possiamo anche immettere “right”, “left”, “up”, “bottom”.