css实现圆柱

​​​​​​纯css实现圆柱体-超简单! - 走看看

css实现圆柱的形状_爱吃烧鸭蛋的叶安的博客-CSDN博客_css实现圆柱体

/*外柱子*/
<div 
  className="yellow-out-bar" 
/* 外柱子 = 外柱子+内柱子 保证外柱子永远比内柱子 高*/
  style={{ height: multiply(add(外柱子, 内柱子)), 2.5) }}
>
/*内柱子*/
  <div 
   className="yellow-inner-bar" 
   style={{ height: multiply(内柱子, 1.5) }} 
  />
</div>





/* 黄色柱子 */
  .yellow-out-bar {
    position: relative;
    width: 26px;
    background-color: transparent;
    border-right: 1px solid #c1a237;
    border-left: 1px solid #b49133;
    background-image: linear-gradient(to left,rgb(156 115 42 / 51%),30%,#af8b30cc,rgb(33 87 129 / 36%));
  }
        .yellow-out-bar:before {
          position: absolute;
          content: '';
          display: block;
          height: 22px;
          width: 100%;
          border-radius: 50%;
          top: -10.5px;
          z-index: 4;
          background-color: rgb(175 139 48);
          border: 1px solid #f9e963;
        }

        .yellow-out-bar:after {
          position: absolute;
          content: '';
          display: block;
          height: 18px;
          width: 100%;
          border-radius: 50%;
          bottom: -10px;
          border: 1px solid #bba53d;
          background-image: linear-gradient(to left,rgb(82 42 6),72% ,#9b8319);
}

        .yellow-inner-bar {
          border-left: #feee6b;
          border-right: #feee6b;
          position: absolute;
          bottom: 5px;
          width: 20px;
          left: 2px;
          height: 50%;
          background-image: linear-gradient(to left,rgb(221 203 70),82% ,#e7d74a);
          text-align: center;
          z-index: 3;
        }
        .yellow-inner-bar::before {
          position: absolute;
          content: '';
          display: block;
          height: 17px;
          width: 100%;
          background-color: rgb(221 202 67 / 90%);
          border-radius: 50%;
          top: -9.5px;
          z-index: 1;
          border: 1px solid rgb(229 241 134);
        }
        .yellow-inner-bar:after {
          position: absolute;
          content: '';
          display: block;
          height: 17px;
          width: 100%;
          border-radius: 50%;
          background-color: #e9d849;
          background-image: linear-gradient(to left,rgb(222 203 70),82% ,#f4e350);
          bottom: -10px;
          z-index: 2;
          border-bottom: 1px solid #f8eb65;
        }

`

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值