gpt4 book ai didi

html - 如何为我的 hr 标签获取渐变边框

转载 作者:行者123 更新时间:2023-11-28 04:29:58 25 4
gpt4 key购买 nike

我想要恰好 50% 的红色并保留任何其他颜色。我是网页设计新手,请帮助我。

hr{
background: red;
background: -webkit-linear-gradient(red, yellow);
background: -o-linear-gradient(red, yellow);
background: -moz-linear-gradient(red, yellow);
background: linear-gradient(red, yellow);
}
<hr style="width:100%; height:5px;">

最佳答案

这些是你问题的答案

hr{ background: red; /* For browsers that do not support gradients */ 
background: -webkit-linear-gradient(left, red , yellow); /*For Safari 5.1 to 6.0 */
background: -o-linear-gradient(right, red, yellow); /* For Opera 11.1 to 12.0 */
background: -moz-linear-gradient(right, red, yellow); /* For Firefox 3.6 to 15 */
background: linear-gradient(to right, red , yellow); /* Standard syntax */ }
.hr2{
height: 25px;
background: red;
background: -webkit-linear-gradient(red 50%, yellow 50%);
background: -o-linear-gradient(red 50%, yellow 50%);
background: -moz-linear-gradient(red 50%, yellow 50%);
background: linear-gradient(red 50%, yellow 50%);
}
<hr style="height:10px;">
<hr style="height:10px;" class="hr2">

关于html - 如何为我的 hr 标签获取渐变边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39599263/

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