效果如图
<!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>左侧竖条实现方法</title>
<style>
/*通用css*/
div{
position:relative;
width:100px;
height:30px;
background: #d8d4c1;
}
/*方法一:用border*/
/*div{
border-left:3px solid #b0ac98;
}*/
/*方法二:伪元素*/
/*div::after{
content: "";
width: 3px;
height: 30px;
position: absolute;
top:0;
left: 0;
background: #b0ac98;
}*/
/*方法三:使用box-shadow*/
/*div{
box-shadow:inset 3px 0px 0px 0px #b0ac98;
}
div{
box-shadow:-3px 0px #b0ac98;
}*/
/*方法四:drop-shadow*/
div{
filter:drop-shadow(-3px 0 0 #b0ac98);
}
/*方法五:渐变linearGradient*/
/*div{
background-image:linear-gradient(90deg, #b0ac98 0, #d8d4c1 5px );
}*/
</style>
</head>
<body>
<div></div>
</body>
</html>