当前位置:网站首页>文本截取图片(哪吒之魔童降世壁纸)
文本截取图片(哪吒之魔童降世壁纸)
2022-07-27 14:39:00 【前行的枫】
background-clip:text兼容性不太好
1.文字截取背景色:兼容IE9+、Firefox、Opera、Chrome 以及 Safari
2.文字截取背景图片:只兼容Chrome
效果图:
<style> body, html {
width: 100%;
height: 100%;
background: #000;
overflow: hidden;
}
* {
padding: 0;
margin: 0;
}
div span {
display: inline-block;
width: 100%;
height: 100%;
background: url('http://img1.imgtn.bdimg.com/it/u=4003626994,439538869&fm=11&gp=0.jpg') no-repeat;
background-size: cover;
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font-size: 20px;
font-weight: bolder;
}
</style>
<div>
<span></span>
</div>
var span = document.getElementsByTagName('span')[0];
var spanText = '';
for (var i = 0; i < 360; i++) {
spanText += '哪吒魔童降世'
}
span.innerHTML = spanText;
边栏推荐
- Talk about ThreadLocal
- The difference between synchronized and reentrantlock
- /Dev/loop1 takes up 100% of the problem
- Interview focus - TCP protocol of transport layer
- Pycharm导入已有的本地安装包
- go语言慢速入门——基本内置类型
- Sword finger offer 51. reverse pairs in the array
- The risk of multithreading -- thread safety
- 面试重点——传输层的TCP协议
- Network principle (1) - overview of basic principles
猜你喜欢

C language: minesweeping games

Spark 3.0 DPP implementation logic

Six capabilities of test and development

Using Lombok results in the absence of parent class attributes in the printed toString

多线程带来的的风险——线程安全

DRF学习笔记(二):数据反序列化

Is the array name the address of the first element?
![[sword finger offer] interview question 54: the k-largest node of the binary search tree](/img/13/7574af86926a228811503904464f3f.png)
[sword finger offer] interview question 54: the k-largest node of the binary search tree

C language: data storage

Flask连接mysql数据库已有表
随机推荐
The difference between synchronized and reentrantlock
Analysis of spark task scheduling exceptions
可载100人!马斯克发布史上最强“星际飞船” !最早明年上火星!
网络原理(1)——基础原理概述
[sword finger offer] interview question 49: ugly number
Addition, deletion, query and modification of MySQL table data
聊聊ThreadLocal
Half find
[sword finger offer] interview question 42: the maximum sum of continuous subarrays -- with 0x80000000 and int_ MIN
逗号操作符你有用过吗?
Multimap case
传音控股披露被华为起诉一事:已立案,涉案金额2000万元
Flask连接mysql数据库已有表
Clickhouse 20.x distributed table testing and chproxy deployment (II)
判断数据的精确类型
C语言实现字节流与十六进制字符串的相互转换
openwrt 增加RTC(MCP7940 I2C总线)驱动详解
【云享读书会第13期】FFmpeg 查看媒体信息和处理音视频文件的常用方法
Sword finger offer 51. reverse pairs in the array
DRF学习笔记(五):视图集ViewSet