Gif Animation as Background Image?

Hi everybody,
Just a fast question. Can I use a gif animation as a background image in html?

hmm, thats kinda a iffy question.I mean whats the gif animation look like?I usually dont set my background images in the html.I set all background images in the CSS document.Is their animation going on in the Gif file?Because alot of people can save images as .Gif Files without giving them Animation.

Yes, you can use an animated GIF as an animated background cross-browser in the CSS, if I understand your question right. :slight_smile:

That’s how I understood his question as well.

So basically YES, you can use.

yes you can.

The background image is in an embedded CSS tag through Dreamweaver.

Thank you for the feedback.

it will take longer for your page to load if you’ll do that.

The background image is in an embedded CSS tag through Dreamweaver.

This is the Way of Evil, just so you know.

Hyperjeds is right in that bg images load slower (actually, last) than HTML <img>s but Stu Nichols has done some pretty fun stuff with animated background which only appear on :hover or :focus. Google it.

Yep you can indeed, this is what I used to place an animated ajax loading gif on the page :

background-image: url(“ajax-loader.gif”);
background-repeat: no-repeat;

Yes is the answer, you can also do an experiment… :slight_smile:

Animated background images? Surely that is counterproductive as it will draw the visitor away from your content with all the visual “flashy” stuff going on in the background. :confused:

Depends on the size of the image you could also apply some code that the web page loads before the image or that the image only loads …kb a second

You can, as so many have already said, but you really want to be careful. I remember a site a teacher created for her classroom that used a tiling GIF of a biplane swooping at the viewer. When looking at the site, with the tiling and the animation, I felt like a bug being strafed by Snoopy’s Sopwith Camel. Impossible to use the site for anything except induced vomiting. :smiley: