思路:
给盒子的boeder-left和border-right设置相应属性,让其分别显示红色和蓝色,还要给div设置一个height,代码如下:
<!DOCTYPE html >
<html>
<head>
<style>
.half{
height: 50px;
width: 0px;
border-left: 50px solid red;
border-right: 50px solid blue;
}
</style>
</head>
<body>
<div class='half'>
</div>
</body>
</html>
效果图: