Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

cssで90度以上の矢印を作る

More than 3 years have passed since last update.

画像のスライドボタンなどでよくある、縦に広がっている矢印をcssだけで作ります。
arrow.png

<p class="big-arrow-right"></p>
.big-arrow-right{
  position: relative;
}
.big-arrow-right::before {
    content:' ';
    width: 50px;
    height: 50px;
    border-right: solid 4px #ccc;
    transform: rotate(35deg);
    position: absolute;
    top: calc(50% - 19px);
    right: 10px;
}

 .big-arrow-right::after {
   content:' ';
   width: 50px;
   height: 50px;
   border-right: solid 4px #ccc;
   transform: rotate(-35deg);
   position: absolute;
   top: calc(50% - 32px);
   right: 10px;
 }

before、afterを二つ使って、上の矢印と下の矢印をくっつけています。
top: calc(50% - 19px);top: calc(50% - 32px);なので、微妙にセンターになっていないかもしれません。

takeshi-nagaoka
冬は東京でマークアップエンジニア、夏はモンゴルで騎馬隊ツアー、キルギスで乗馬ツアーをやっています。
http://takessii.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away