svg背景

In the previous article I introduced using SVG in a tiled background images for web pages. Those simple stripes and lines can be expanded to more complex shapes, mixed with blend modes and bitmap images to create layered “pop art” backgrounds. These techniques allow for richer visual effects with easier code and more flexibility than my previous attempt using CSS gradients.

在上一篇文章中,我介绍了在网页的平铺背景图像中使用SVG的方法 。 这些简单的条纹和线条可以扩展为更复杂的形状,并与混合模式和位图图像混合以创建分层的“波普艺术”背景。 与我以前使用CSS渐变的尝试相比,这些技术可以通过更轻松的代码和更大的灵活性提供更丰富的视觉效果。

棋盘 (Checkerboard)

Creating an SVG checkboard is a matter of using just two square elements in a diagonal arrangement:

创建SVG棋盘只需要对角线排列使用两个正方形元素即可:

<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50"><g fill="#ccc"><rect width="25" height="25" /><rect x="25" y="25" width="25" height="25" /></g>
</svg>

This creates a pattern like so:

这将创建一个像这样的模式:

Layered with a bitmap image:

用位图图像分层:

section#grid {background-image: url(checkerboard.svg),url(grace-kelly.jpg);background-size: 100px 100px, cover;background-blend-mode: overlay;
}

… creates the first effect shown above. The bitmap image is sized to cover the area of the element; the checkerboard pattern repeats every 100 pixels, both horizontally and vertically. But rather than simply layering over the image, it blends with it in overlay mode.

…创建上面显示的第一个效果。 调整位图图像的大小以覆盖元素的区域; 棋盘图案在水平和垂直方向上每100像素重复一次。 但是,它不仅仅是在图像上分层,而是以overlay模式与图像融合。

圆点 (Polka Dots)

A similar idea can be used to pattern images with polka dots, using five SVG circles: one in the exact center of the SVG viewBox, and the remaining four with their centers at each corner:

使用五个SVG圆可以使用类似的想法来图案化带有圆点的图像:一个在SVG viewBox正中央,另一个在每个角的中心:

<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><style type="text/css">circle { fill: #f99; }</style><circle cx="0" cy="0" r="100"/><circle cx="300" cy="0" r="100"/><circle cx="0" cy="300" r="100" /><circle cx="300" cy="300" r="100"/><circle cx="150" cy="150" r="100"/>
</svg>

Which creates this pattern:

创建此模式:

This code is saved as circle-grid.svg and layered with a bitmap image in the background of an element:

这段代码保存为circle-grid.svg并在元素的背景中分层circle-grid.svg了位图图像:

section#circles {background-image: url(kelly-brook-as-gilda.jpg),url(circle-grid.svg);background-size: cover, 100px 100px;background-blend-mode: multiply;
}

结论 (Conclusion)

This should give you some idea as to how to proceed with your own ideas; there are many more possibilities for these kinds of designs, which I’ll explore in future articles.

这应该使您对如何继续自己的想法有所了解; 这些类型的设计还有更多的可能性,我将在以后的文章中进行探讨。

翻译自: https://thenewcode.com/1047/Pop-Art-Backgrounds-with-SVG-Blend-Modes

svg背景

svg背景_具有SVG和混合模式的波普艺术背景相关推荐

  1. svg波纹_使用SVG创建材质设计波纹效果

    svg波纹 View demo 查看演示Download Source 下载源 With the advent of Google's Material Design came a visual la ...

  2. 界面上展示svg图片_使用SVG创建SciFi用户界面元素

    界面上展示svg图片 For some reason, clipped corners on UI elements is visual shorthand for "the future& ...

  3. python爬虫背景_利用Python代码实现一键抠背景功能

    前言 又是一个逛csdn发现的一个有趣的小项目,可以一键抠背景,需要用到removebg模块及其API,API可从其官网免费获取,网址如下https://www.remove.bg/zh ps:加上/ ...

  4. 修改图片背景_用P图软件将图片背景更改

    有很多软件都可以更改背景的颜色,我今天来说一下怎么用picsArt(美易)来更改图片的背景 ① 首先选择你想要更改背景的图片,选择剪影,他会大致勾选图片中的人物,但不是很灵敏,所以有些细节需要自己去勾 ...

  5. 自定义背景_新版快绘精选:自定义背景墙 | 吊顶 | 云渲染滤镜升级

    New自定义背景墙 没有合适的背景墙样板? 你需要一个全世界独一无二, 独属于你monent的背景墙? 没问题! 无论是要这样↓ 还是这样↓ 快绘都能帮到你! -- 请观看视频 -- New自定义吊顶 ...

  6. android开发 修改标题栏背景_移动开发整体凉凉的背景下,究竟还剩哪些 Android热门前沿知识...

    1. Android架构设计模式 MVC架构设计模式:MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写. MVP架构 ...

  7. html svg 背景,可自定义 SVG 背景素材站

    可自定义 SVG 背景素材站 2月 13, 2018 评论 Sponsor 为适应目前市面上那么多高分屏,用 SVG 图像作为网页背景元素是很好的一个方案,因为它最大的特点是矢量图,在任何高分屏下都能 ...

  8. css svg使用_使用CSS使SVG响应

    css svg使用 An SVG can be embedded on a web page in many ways; one of which is embedding it inline in ...

  9. html svg 背景图片,在CSS背景图片中使用svg的用法介绍(附示例)

    本篇文章给大家带来的内容是关于在CSS背景图片中使用svg的用法介绍(附示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助. 在CSS背景图片中使用SVG,可以使用css backg ...

最新文章

  1. Java 洛谷 P1424 小鱼的航程(改进版)
  2. 开始报名!首次阿里巴巴经济体双 11 云原生实践展示
  3. 获取计算机的信息(IP地址、MAC地址、CUP序列号、硬盘序列号、主板信息等等)...
  4. RabbitMq、ActiveMq、ZeroMq、kafka之间的比较,资料汇总
  5. 两阶段3D目标检测网络 SIENet: Spatial Information Enhancement Network for 3D Object Detection from Point Cloud
  6. finereport字段显示设置_QA | 表单如何设置字段显示逻辑?
  7. mysql技术简介_MySQL数据类型介绍
  8. 原地踏步 – 没有突破高效理念的结果
  9. C小项目 简易英汉词典
  10. 10KV变配电增容工程电力监控系统的设计与应用
  11. 读研究生应该做什么?导师会帮你什么?
  12. 安装算量软件快速选择计算图元
  13. HBase 怎样负载均衡?
  14. 给大家分享下仿QQ消息页面横向滑出菜单,Item内容较多的情况
  15. word中间空白页删除技巧
  16. 递归算法时间复杂度分析
  17. netsh interface portproxy本地ip与端口映射及本地虚拟ip(windows)
  18. Android-S SystemServer
  19. yolov5篇---官方代码docker部署训练
  20. PyTorch模型训练的几个加速技巧

热门文章

  1. JavaScript-----详细讲解js节点以及节点操作
  2. maven日志打印,解决logger.info打印内容无法显示
  3. 背后的故事和故事的背后(1)
  4. 如何用python判断字符串包含多个字符串中的一个或多个?
  5. html5 Game开发系列文章之 三 搭建基本游戏框架(代码封装)
  6. c语言生命字符串,常见的C语言字符串操作
  7. OpenLayers实例-Animated GIF-GIF动画
  8. 【flutter 动画汇总】
  9. mosquitto客户端对象“struct mosquitto *mosq”管理下篇(mosquitto2.0.15客户端源码分析之四)
  10. git 中merge的用法