1、
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<style>
//第一种
div{
width: 0;
height: 0;
border: 100px solid transparent;
border-bottom: 100px solid blue;
}
//第二种
div {
width: 0;
height: 0;
border: 40px solid;
border-color: transparent transparent red;
}
</style>
<body>
<div></div>
</body>
在css3中,我们主要使用的是一个transparent的属性,意思是透明的,比如我们将字体设置为黑色会写color:black,那么如果想把字体的颜色设置为透明,我们可以写color:transparent。同理background-color:transparent可以设置背景为透明