天天看點

通過css切割隐藏外邊框,實作十字架或者網格效果

實作代碼:

<style type="text/css">
			div{
				margin: 40px;
				width: 320px;
				height: 300px;
				overflow: hidden;/*超出部分隐藏,切割掉下邊框和右邊框*/
			}
			div ul{
				/*一個li元素寬度為81px,width大小隻要大于(81 x 4)324px,一排就能顯示四個li元素*/
				width: 325px;
			}
			div ul li{
				/*設定右邊框和下邊框*/
				border-bottom: 1px solid red;
				border-right: 1px solid red;
				list-style: none;
				height: 100px;
				width: 80px;
				float: left;
			}
		</style>
           

實作效果:

通過css切割隐藏外邊框,實作十字架或者網格效果