Can I have multiple background images using CSS?

Is it possible to have two background images? For instance, I'd like to have one image repeat across the top (repeat-x), and another repeat across the entire page (repeat), where the one across the entire page is behind the one which repeats across the top. I've found that I can achieve the desired effect for two background images by setting the background of html and body: html { background: url(images/bg.png); } body { background: url(images/bgtop.png) repeat-x; } Is this "good" CSS? Is there a better method? And what if I wanted three or more background images?

以上就是Can I have multiple background images using CSS?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准