Jump to content

Random Background images


carinac

Recommended Posts

it's possible to do this with css

$images: ('http://link-to-image-1', 'http://link-to-image-2',  'http://link-to-image-3');

$img: nth($images, random(length($images)));

body {
  background: url($img) top center no-repeat;
}
Link to comment
Share on other sites

 

it's possible to do this with css

$images: ('http://link-to-image-1', 'http://link-to-image-2',  'http://link-to-image-3');

$img: nth($images, random(length($images)));

body {
  background: url($img) top center no-repeat;
}

In the global css? That is all? feels like there would be more to add somewhere.

Link to comment
Share on other sites

yes global.css, anywhere you want (the best: at the end)

maybe it will be necessary to add !Important here

body {
background: url($img) top center no-repeat!important;
}

if you want to rotate background only - that's all :-)

Link to comment
Share on other sites

yes global.css, anywhere you want (the best: at the end)

maybe it will be necessary to add !Important here

body {
background: url($img) top center no-repeat!important;
}

if you want to rotate background only - that's all :-)

Hmm, it isn't working. I noticed my background image is in the wrapper so I did

.wrapper {

background: url($img) top center no-repeat!important;

}

 

instead, but that also didn't work.

 

Thanks though!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...