html - Css 边框顶部和 bot 线性渐变
问题描述
我想在我的 h2 标签的顶部和底部放置一个渐变边框,但边框底部应该是顶部 bo 的反面。
h2 {
position: relative;
text-transform: uppercase;
font-size: 16px;
color: blue;
line-height: 36px;
letter-spacing: 1.6px;
margin-right: 80px;
border-style: solid;
border-width: 3px;
border-image: linear-gradient(90deg, orange, rgba(253, 142, 41, 0)) 100% 0 100% 0/3px 0 3px 0 stretch;
}
<div class='bloc-content-lower-upper'>
<h2>Découvrir la technologie</h2>
<h2>Test</h2>
</div>
在这里,我有一个带有这个渐变的顶部和底部边框,但我想反转底部的颜色。非常感谢您的帮助。
解决方案
使用背景:
h2 {
position: relative;
text-transform: uppercase;
font-size: 16px;
color: blue;
line-height: 36px;
letter-spacing: 1.6px;
padding: 3px 0;
margin-right:80px;
background:
linear-gradient( 90deg, orange, rgba(253, 142, 41, 0)) top,
linear-gradient(-90deg, orange, rgba(253, 142, 41, 0)) bottom;
background-repeat:no-repeat;
background-size:100% 3px;
}
<div class='bloc-content-lower-upper'>
<h2>Découvrir la technologie</h2>
<h2>Test</h2>
</div>
推荐阅读
- python-3.x - 如何在 rfc-2822 时区之间转换?
- elasticsearch - 单个主机上的 delegate_to 不在 ansible 角色下工作
- flutter - 如何在 Flutter 中创建应用内通知提醒系统?
- amazon-web-services - 如果 AWS VPN 启动但 ping 不起作用,可能会发生什么问题?
- reactjs - 使用版本 7 中的反应挂钩表单上传文件?
- api - 动态字段的输入类型架构
- java - Java Serviceability Agent:如何获取方法参数名称
- python - 将信息从 dict 传递到 snakemake 会导致缺少输入文件错误
- python - 在 Tkinter 中更改标签和同时更改具有相同内部函数的变量有什么区别?
- pine-script - 使用变量设置直线的 x 点