gpt4 book ai didi

html - 将图像转换为 HTML/CSS - 无法获得正确的渐变

转载 作者:太空宇宙 更新时间:2023-11-03 21:32:40 25 4
gpt4 key购买 nike

我一直试图在 HTML/CSS 中模仿这张图片,但没有成功(无法让它看起来相似)。

enter image description here

我试过使用这个网站 http://www.colorzilla.com/gradient-editor/#_但我无法得到模仿它的输出。

这是对 jsfiddle 的尝试 - http://jsfiddle.net/rea2pkho/2/

这是我目前拥有的代码:

<div id="bar"></div>
#bar {
width: 600px;
height: 30px;
background: -moz-linear-gradient(top, rgba(185,185,185,0.25) 0%, rgba(185,185,185,0.25) 96%, rgba(185,185,185,0.19) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(185,185,185,0.25)), color-stop(96%,rgba(185,185,185,0.25)), color-stop(100%,rgba(185,185,185,0.19))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(185,185,185,0.25) 0%,rgba(185,185,185,0.25) 96%,rgba(185,185,185,0.19) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(185,185,185,0.25) 0%,rgba(185,185,185,0.25) 96%,rgba(185,185,185,0.19) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(185,185,185,0.25) 0%,rgba(185,185,185,0.25) 96%,rgba(185,185,185,0.19) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(185,185,185,0.25) 0%,rgba(185,185,185,0.25) 96%,rgba(185,185,185,0.19) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#40b9b9b9', endColorstr='#30b9b9b9',GradientType=0 ); /* IE6-9 */
}

如有任何建议,我们将不胜感激。

谢谢

最佳答案

我推荐 this site生成 CSS 渐变。您的代码似乎以某种方式缺少中间停止点。

background: rgba(181,181,181,1);
background: -moz-linear-gradient(top, rgba(181,181,181,1) 0%, rgba(255,255,255,1) 48%, rgba(184,184,184,1) 100%);
background: -webkit-gradient(left top, left bottom, color-stop(0%, rgba(181,181,181,1)), color-stop(48%, rgba(255,255,255,1)), color-stop(100%, rgba(184,184,184,1)));
background: -webkit-linear-gradient(top, rgba(181,181,181,1) 0%, rgba(255,255,255,1) 48%, rgba(184,184,184,1) 100%);
background: -o-linear-gradient(top, rgba(181,181,181,1) 0%, rgba(255,255,255,1) 48%, rgba(184,184,184,1) 100%);
background: -ms-linear-gradient(top, rgba(181,181,181,1) 0%, rgba(255,255,255,1) 48%, rgba(184,184,184,1) 100%);
background: linear-gradient(to bottom, rgba(181,181,181,1) 0%, rgba(255,255,255,1) 48%, rgba(184,184,184,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b5b5b5', endColorstr='#b8b8b8', GradientType=0 );

Fiddle

关于html - 将图像转换为 HTML/CSS - 无法获得正确的渐变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28521924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com