使用CSS更改背景 [英] Change of background using CSS

查看:219
本文介绍了使用CSS更改背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过点击按钮仅使用CSS来更改页面的背景图片?我有6个按钮,我想改变整个页面的背景图片,以改变按钮点击。

Is it possible to change background image of page by click on button using only CSS? I have 6 buttons, and I want to change background image of whole page to be changed on button click.

只有css可以吗?如果是,那么如何?

Is it possible with only css? If yes, then how?

推荐答案

这将是很好,但没有。

That would be nice, but no.

你不需要那么难的功能,但。只需附加背景更改与按钮的其余功能。我建议在这种情况下,你只是添加背景图像作为css内联与您的js,因为6类的图像可以出错容易。

You don't need that hard a function, though. Simply attach the background change with the rest of the functionality of the button. I recommend in this case that you just add the background image as css inline with your js, because 6 classes of images can go wrong easy.

这篇关于使用CSS更改背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆