How can I create a round arrow with only HTML and CSS?

后端 未结 6 1137
挽巷
挽巷 2020-12-05 04:32

I\'m trying to create a round directional arrow with CSS and HTML. Below are my attempts.

Attempt 1

In this I have rotated the

and
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 04:47

    I have created this little thing in CSS, you can look at the code to see how it works.

    Note: this does need a solid background.

    .arrow {
      width: 200px;
      height: 200px;
      border: 6px solid;
      border-radius: 50%;
      position: relative;
    }
    .arrow:before {
      content: "";
      display: block;
      width: 10px;
      height: 50px;
      background: #fff;
      position: absolute;
      bottom: 0;
      top: 0;
      right: -6px;
      margin: auto;
    }
    .arrow:after {
      content: "";
      width: 0;
      height: 0;
      border-left: 20px solid transparent;
      border-right: 20px solid transparent;
      border-top: 20px solid #000;
      position: absolute;
      bottom: 106px;
      right: -20px;
    }

提交回复
热议问题