LoginSignup
0
0

More than 3 years have passed since last update.

【CSS】border-radius

Posted at

border-radius

:sunny: 角を丸める

角を丸めるとはなんじゃそりゃ??:thinking:
という感じですが、図をみてもらうと一目瞭然です:smile:

スクリーンショット 2020-01-17 2.41.23.png

図のように角が丸くなります:laughing:

例.html
    <div class="square">
      <p>四角でーす</p>
    </div>
    <div class="corners">
      <p>角丸でーす</p>
    </div>
例.css
.square {
  width: 150px;
  height: 100px;
  background-color: orange;
  text-align: center;
}

.corners {
  width: 150px;
  height: 100px;
  background-color: orange;
  text-align: center;
  border-radius: 30px;

上記では border-radius: 30px; で指定しましたが
数字を 50px に指定すると・・・

スクリーンショット 2020-01-17 2.48.37.png

30px に比べてさらに角が丸くなりました:laughing:
・・・ということは今度は 10px にして数字を小さくすると

スクリーンショット 2020-01-17 2.50.37.png

さっきに比べて角張っちゃいました:sweat_smile:
つまりは・・・

数字が大きくなればなるほど角は丸くなるということがわかりました:smile:

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