CSS实现中间粗两头细的线条
作者:互联网
通过给一个盒子添加渐变背景的方式来实现画一条中间粗两头细的线条的效果
效果如图:
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS实现中间粗两头细的线条</title>
<style>
.line{
width: 500px;
height: 1px;
background: -webkit-linear-gradient(left, #fff -4%,#ff0000 50%,#fff 100%);
}
</style>
</head>
<body>
<div class="line"></div>
</body>
</html>
标签:实现,中间,CSS,fff,两头,线条 来源: https://blog.csdn.net/http____/article/details/122601377