background-clip属性:剪裁文本,
注:要和-webkit-text-fill-color属性设置为transparent,确保文字的填充色为透明色,一起使用
浏览器兼容问题:
-webkit- 谷歌浏览器的内核标识码
-moz- 火狐浏览器的内核标识码
-o- 欧朋浏览器的内核标识码
-ms- IE浏览器的内核标识码
代码:
Markup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.title{
width: 80%;
height: 500px;
line-height: 220px;
text-align: center;
margin: 0 auto;
background: url("./img/pic1.jpg");
font-size: 60px;
-webkit-background-clip: text;
-webkit-text-fill-color: