html四边形的的框怎么编写,CSS平行四边形切割边框图案

能够使用直线css制作一个非常相似的边框。

首先,在之前,生成了一个包含3个条纹的盒子 - 一个红色,一个蓝色,一个米色。此外还添加了米色边框。

然后,在:伪元素之后,只给了一个米色的背景(也许可以用渐变背景看起来更好)。

检查出来:

p.box:before{

content: '';

position: absolute;

z-index: -1;

width: 100%;

height: 100%;

background:repeating-linear-gradient(

45deg,

hsl(60, 56%, 81%) 0px,

hsl(60, 56%, 81%) 4px,

red 5px,

red 14px,

hsl(60, 56%, 81%) 15px,

hsl(60, 56%, 81%) 20px,

hsla(247, 83%, 37%, 1) 21px,

hsla(247, 83%, 37%, 1) 30px

),

linear-gradient(

to bottom,

rgba(48, 26, 255, 1),

rgba(85, 66, 255, 1)

);

border: 5px solid hsl(60, 56%, 81%);

}

p.box:after{

content: '';

position: absolute;

right: -.5%;

bottom: -2.5%;

background: hsl(60, 56%, 81%);

z-index: -1;

height: 97%;

width: 97%;

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值