mynameisjohnahahah / Notes

记录平时看到对自己有帮助的内容
0 stars 0 forks source link

css3 #13

Open mynameisjohnahahah opened 5 years ago

mynameisjohnahahah commented 5 years ago

渐变

给div添加条纹背景

斜着得

background-size: 10px 10px;
background-color: #fff;
background-image: -webkit-linear-gradient(-45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2) 75%, transparent 75%, transparent));
background-image: linear-gradient(-45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2) 75%, transparent 75%, transparent)

横着的

linear-gradient改成0

竖着的

linear-gradient改成90