首先准备一张雪碧图,Like this 背景图片的定位方法有3种,比较常用的两种为 关键字:background-position: top left; (top/bottom/cennter/left/right) 像素:background-position: 水平移动px 垂直移动px; 关键词: 其中关键字方法background-position: top left 和left top效果是一样的.(注意:如果您仅规定了一个关键词,那么第二个值将是"center".) 关于像
JavaScript实现网页背景自动变色,自己变换颜色,设定时间和颜色值即可,在你设定的颜色值.一定时间内自动切换网页背景颜色. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type&
一.效果图 二.代码 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.title = @"背景颜色的随机显示"; } //点击视图,视图颜色随机更改 - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent