当前位置 : 主页 > 网页制作 > css >

css3支持为网页添加多个背景图片吗

来源:互联网 收集:自由互联 发布时间:2021-09-04
css3支持为网页添加多个背景图片。在css中,可以通过直接在background-image属性中指定多个背景路径来为网页添加多个背景图片,语法格式“background-image: url(图片地址), url(图片地址)...;”

css3支持为网页添加多个背景图片。在css中,可以通过直接在background-image属性中指定多个背景路径来为网页添加多个背景图片,语法格式“background-image: url(图片地址), url(图片地址)...;”。

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。

在CSS中使用多个背景图片

如果想在背景中添加一张以上的图片怎么办?CSS3 中可以直接 指定多个背景路径,如下所示:

body {
  background-image: url(https://image.flaticon.com/icons/svg/748/748122.svg), url(https://images.unsplash.com/photo-1478719059408-592965723cbc?ixlib=rb-1.2.1&auto=format&fit=crop&w=2212&q=80);
  background-position: center, top;
  background-repeat: repeat, no-repeat;
  background-size: contain, cover;
}

效果图:

1.png

完整示例地址:https://codepen.io/duomly/pen/eYpVoJR

(学习视频分享:css视频教程)

以上就是css3支持为网页添加多个背景图片吗的详细内容,更多请关注自由互联其它相关文章!

网友评论