1、首先新建一个html文件,命名为test.html,在test.html文件中,使用div标签创建一个模块,用于测试。

2、在test.html文件中,给div标签添加一个class属性,用于下面样式设置。

3、在css标签内,通过class设置div的样式 ,定义它的宽度为300px,高度为300px,并设置它的背景图片为1.png。

4、在css标签内,再通过将background-position属性设置为“center right”,实现背景图片靠右居中。

5、最后在浏览器打开test.html文件,查看实现的效果。
