Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 使渐变边框看起来像一条线_Css_Gradient_Linear Gradients - Fatal编程技术网

Css 使渐变边框看起来像一条线

Css 使渐变边框看起来像一条线,css,gradient,linear-gradients,Css,Gradient,Linear Gradients,如何使颜色之间的渐变边界看起来像一条线?是否有一种方法可以在左下角开始,而不是在按钮的右边?我使用这个css来实现: background: linear-gradient(to right bottom, #00C9FF 30%, black 50%) 您可以使用以下代码获得预期结果: div{ 背景:线性梯度(至右下,#00C9FF钙(50%-1px),黑色钙(50%+1px)); 边框:7px实心#00C9FF; 颜色:#fff; 高度:100px; 线高:100px; 文本对齐:居中

如何使颜色之间的渐变边界看起来像一条线?是否有一种方法可以在左下角开始,而不是在按钮的右边?我使用这个css来实现:

background: linear-gradient(to right bottom, #00C9FF 30%, black 50%)

您可以使用以下代码获得预期结果:

div{
背景:线性梯度(至右下,#00C9FF钙(50%-1px),黑色钙(50%+1px));
边框:7px实心#00C9FF;
颜色:#fff;
高度:100px;
线高:100px;
文本对齐:居中;
宽度:100px;
}

测试
您应该将两种颜色移动到同一位置:

background: linear-gradient(to right bottom, #00C9FF 30%, black 30%);
你是说像这样吗?