SVG背景图笔记

url引用格式:url('data:image/svg+xml;base64')

实例:

准备好SVG文件

源码:

1<!doctype html> 2<html lang="en"> 3<head> 4 <meta charset="UTF-8"> 5 <title>Document</title> 6</head> 7<style> 8 body{ /*base64代码--直接复制SVG文件里的所有代码*/ 9 background: rgb(255,255,255) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='100' viewBox='0 0 200 100' preserveAspectRatio='none'><defs><radialGradient id='rg1' cx='0%' cy='0%' r='100%' fx='0%' fy='0%'><stop offset='0%' style='stop-color: #a480ff; stop-opacity: 0.5' /><stop offset='100%' style='stop-color: #a480ff; stop-opacity:0' /></radialGradient><radialGradient id='rg2' cx='100%' cy='0%' r='100%' fx='100%' fy='0%'><stop offset='0%' style='stop-color: #ff8f83; stop-opacity: 0.5' /><stop offset='100%' style='stop-color: #ff8f83; stop-opacity:0' /></radialGradient></defs><polygon points='0,0 125,0 125,100 0,100' style='fill: url(#rg1);' /><polygon points='75,0 200,0 200,100 75,100' style='fill: url(#rg2);' /></svg>") no-repeat; 10 -webkit-background-size: 100% auto; 11 background-size: 100% auto; 12 } 13</style> 14<body> 15</body> 16</html>

效果:

SVG参考手册http://www.runoob.com/svg/svg-reference.html

点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

AndroidStudio封装SDK的那些事

<divclass"markdown\_views"<!flowchart箭头图标勿删<svgxmlns"http://www.w3.org/2000/svg"style"display:none;"<pathstrokelinecap"round"d"M5,00,2.55,5z"id"raphael

Java获得今日零时零分零秒的时间(Date型)

publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS