gpt4 book ai didi

html - 是否可以在背景中制作一个带有箭头和渐变的圆圈?

转载 作者:太空宇宙 更新时间:2023-11-04 13:39:11 24 4
gpt4 key购买 nike

我需要制作一个带有箭头和内部渐变的圆圈。我知道我可以将它用作图像。但它需要在屏幕调整大小时灵活,以便背景渐变会动态变化。我很好奇是否可以使用单个 <span> 来做到这一点标记和 CSS。

enter image description here

enter image description here

最佳答案

编辑:
Button css3
下面是一个使用两个 div 来模拟使用旋转和边框半径的箭头的示例:

DEMO

  .btn{
cursor:pointer;
position:relative;
font-family:'Trebuchet MS', Verdana, Arial, sans-serif;
display:inline-block;
padding:3px 0 3px 16px;
text-align:center;
height:22px;
color:#696969;/*#DB7DB4;*/
text-shadow:0px 1px 1px #fff;
-webkit-border-radius: 22px;
-moz-border-radius: 22px;
border-radius: 22px;
border:1px solid rgba(220,87,166,0.8);
box-shadow: 0px 0px 0px 3px rgba(220,87,166, 0.8);

background: #fafafa; /* Old browsers */
background: -moz-linear-gradient(top, #fafafa 0%, #939393 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fafafa), color-stop(100%,#939393)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #fafafa 0%,#939393 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #fafafa 0%,#939393 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #fafafa 0%,#939393 100%); /* IE10+ */
background: linear-gradient(top, #fafafa 0%,#939393 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fafafa', endColorstr='#939393',GradientType=0 ); /* IE6-9 */
}

.btn_circle{
position:relative;
float:right;
margin:0px 3px 0 8px;
display:table;
width:20px;
height:21px;
border:1px solid rgba(255,255,255,0.6);
border-radius:21px;
box-shadow: inset 0px 3px 2px rgb(92, 38, 70);
background: #6b294f; /* Old browsers */
background: -moz-linear-gradient(top, #6b294f 0%, #BE609E 99%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6b294f), color-stop(99%,#BE609E)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #6b294f 0%,#aa6592 99%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #6b294f 0%,#BE609E 99%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #6b294f 0%,#BE609E 99%); /* IE10+ */
background: linear-gradient(top, #6b294f 0%,#BE609E 99%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b294f', endColorstr='#aa6592',GradientType=0 ); /* IE6-9 */
}

.btn_arr{
position:absolute;
right:8px;
height:3px;
width:10px;
background:#d9d9d9;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
box-shadow:-1px 0px 1px #6F375D;
}
.btn_top{
top:11px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
transform: rotate(45deg);
}
.btn_bot{
top:16px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
transform: rotate(-45deg);
}

旧帖:

Button image这是唯一可能的 (AFAIK) css 箭头的示例:

DEMO 1

DEMO 2 (with '>' character)

HTML:

  <div class="circle">
<div class="arrow"></div>
</div>

CSS:

.arrow{
margin:0 auto;
width: 0;
height: 0;
border-top: 8px solid transparent;
border-bottom: 8px solid transparent;
border-left: 8px solid #CFC5CD;
}
.circle{
display:table;
line-height:30px;
width:10px;
height:10px;
padding:3px 5px 3px 7px;
border:2px solid #CFC5CD;
border-radius:21px;
background: #6b294f; /* Old browsers */
background: -moz-linear-gradient(top, #6b294f 0%, #aa6592 99%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6b294f), color-stop(99%,#aa6592)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #6b294f 0%,#aa6592 99%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #6b294f 0%,#aa6592 99%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #6b294f 0%,#aa6592 99%); /* IE10+ */
background: linear-gradient(top, #6b294f 0%,#aa6592 99%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6b294f', endColorstr='#aa6592',GradientType=0 ); /* IE6-9 */
}

关于html - 是否可以在背景中制作一个带有箭头和渐变的圆圈?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8625354/

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