css3 实现一个线性渐变出现的问题?
高洛峰
高洛峰 2016-11-07 15:49:24
0
1
890

892670031-581ee02140c15_articlex.png

.linear {
    position: relative;
    height: 1px;
    width: 100%;
    background: -webkit-linear-gradient(left,#fff 20%,#000 60%,#fff 20%);
}

结果就变成了这样:

892670031-581ee02140c15_articlex.png

不知道哪里出现了问题?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

répondre à tous(1)
三叔
用法:-webkit-linear-gradient(left,#fff 20%,#000 60%, #fff);

颜色断点后面跟着百分比,是整个线性距离的百分比,所以,最前面应该是 0%,最后是 100%,其余百分比依次递增。0% 与 100% 可以省略不写。


Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!