css - 彩虹边框的属性值无效:CSS
问题描述
在网站上,有一条长长的蓝色尾巴。为了骄傲月,我想把这条尾巴改成彩虹。原始CSS代码如下:
.site-header {
background-color: #101625;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 999;
border-bottom: 15px solid #375778;
-webkit-box-shadow: 0 0 60px 0 rgba(16,22,37,1);
box-shadow: 0 0 60px 0 rgba(16,22,37,1);
}
最初,当我在模拟尾巴的外观时,我会检查网站的来源,并将以下代码添加到上面。然后它将工作并将尾巴更改为彩虹:
.site-header {
background-color: #101625;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 999;
border-bottom: 15px solid #375778;
-webkit-box-shadow: 0 0 60px 0 rgba(16,22,37,1);
box-shadow: 0 0 60px 0 rgba(16,22,37,1);background-color: #101625;
border-bottom: 15px solid transparent;
border-top: 0px solid transparent;
border-left: 0px;
border-right: 0px;
border-image: linear-gradient( 45deg, red, orange, yellow, green, blue, indigo, violet, red);
border-image-slice: 1;
}
我现在认识到有一些重复代码,但这个解决方案是有效的。但是,当我去更新真正的 CSS 样式表时,这些更改并没有实现。检查源发现存在无效的属性值。我尝试将代码更正为以下内容,但没有任何改变:
.site-header {
background-color: #101625;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 999;
border-bottom: 15px solid #375778;
-webkit-box-shadow: 0 0 60px 0 rgba(16,22,37,1);
box-shadow: 0 0 60px 0 rgba(16,22,37,1);
border-bottom-width: 15px solid;
border-bottom-style: transparent;
border-image-repeat: linear-gradient( 45deg, red, orange, yellow, green, blue, indigo, violet, red);
border-image-slice: 1;
}
任何帮助将不胜感激。
解决方案
尝试:
.site-header {
background-color: #101625;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 999;
border-bottom: 15px solid #375778;
-webkit-box-shadow: 0 0 60px 0 rgba(16, 22, 37, 1);
box-shadow: 0 0 60px 0 rgba(16, 22, 37, 1);
border-bottom-width: 15px solid;
border-bottom-style: transparent;
border-image: repeating-linear-gradient( 45deg, red, orange, yellow, green, blue, indigo, violet, red);
border-image-slice: 1;
}
<div class="site-header"></div>
推荐阅读
- python - 如何使用python条带支付确认支付访问网页
- javascript - 使用 NGINX 时无法在 Node.js 下使用 AJAX 发出 GET 请求
- mysql - 在 MySql 中创建一个 ID 为 CHV18000002 的列
- python - TypeError: can't pickle cv2.xfeatures2d_SIFT objects(在使用 joblib.Parallel 期间发生)
- reactjs - 连接 react-redux store 到 express + mysql 后端
- python - 在 python 中异或大量二进制数组的最快方法是什么?
- batch-file - 根据数字范围显示单个输出(if, goto)
- java - 我无法在 java gpdr 协议上加载表单
- javascript - Js对象分配到另一个对象的子字段
- proxy - 如何使用 Nginx 部署 JupyterHub?