0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

border-radius 長方形+半円の作り方

Last updated at Posted at 2023-12-02
.rectangle {
    border-radius: 9999px;
}

こちらはiOS Safariでもスタイルが当たってくれることはテスト済み。

上記でもいいが、9999pxというのは嫌なので、
以下書き方でも長方形+半円のデザインが実現可能。

注意: iOS Safariだと効かないことが判明 2024.6.18現在

.rectangle {
    border-radius: calc(Infinity * 1px); // calc(1px / 0)
}

iOS Safari以外ならスタイルが当たる。

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?