0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CSSで三角形を作る

Last updated at Posted at 2020-11-08

■ はじめに

タイトルについて記事にしました。
この記事で得る内容は以下の通りです。

・CSSの基礎知識が増える
・CSSで三角形を扱う

↓ 便利なサービス
CSS三角形作成ツール

■ 例

親要素divと子要素spanがあってspanを三角形とする場合です

スクリーンショット 2020-11-08 14.23.05.png

index.scss
div {
  position: relative;
  // その他省略
  span {
    position: absolute;
    top: 100%;
    left: 47%;
    border-style: solid;
    border-width: 15px 50px 0 50px;
    border-color: #3b4552 transparent transparent transparent;
  }
}

positionを使う
topleftを%指定するか、transform: translate();で変更に適応化させる

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?