You can use
media queries
to achieve it.
Example:
body {
background: url(../images/desktop.jpg) no-repeat center center fixed;
}
@media only screen and (min-width : 320px) and (max-width : 480px) {
background: url(../images/mobile.jpg) no-repeat center center fixed;
}
CSS Media Queries: these are media based stylesheets, that enables the content's presentation to be customized to a specific range of output devices without having to change the content itself.