webページのつくり方 | 学びの道

webページのつくり方、web制作、web作成、学びの道を歩み中!フェリカテクニカルアカデミー「東京・池袋」にてWeb作成を勉強中です。学んだ事をメモしていきます。

CSS3 角丸の記載方法②

本日は、CSS3 角丸の記載方法② を記載します。

【記載方法のポイント】

.border-radius-xy {
  -webkit-border-radius: 80px 50px 20px 50px/40px 50px 50px 25px

border-radius: x方向の左上 右上 右下 左下 / y方向の左上 右上 右下 左下;

 

f:id:kaoru01-05:20140620064955p:plain

<!DOCTYPE html>
<html lang="ja">
<head>
<meta name="viewport" content="width=device-width">
<meta charset="utf-8">
<title>border-radius | CSS3</title>
<style>
#main {
  margin: 50px;
}
p{
    text-align:center;
    color:#FC0332;
}
.box-example {
  margin: 20px;
border:5px solid orange;
}
.box-square-basic {
  background:yellow;
  height: 100px;
  width: 100px;
    border:5px solid orange;
}
.box-rectangle-basic {
  background:yellow;
  height: 100px;
  width: 150px;
  border:5px solid orange;
}
.box-half-basic {
  background:yellow;
  height: 50px;
  width: 100px;
  border:5px solid orange;
}

/* border-radius */
.border-radius-round {
  -webkit-border-radius: 50%;
  border-radius: 50%;
}
.border-radius-xy {
  -webkit-border-radius: 80px 50px 20px 50px/40px 50px 50px 25px;
  border-radius: 80px 50px 20px 50px/40px 50px 50px 25px;
}
.border-radius-normal {
  -webkit-border-radius: 4px;
  border-radius: 4px;
}
.border-radius-halfcircle {
  -webkit-border-radius: 50px 50px 0 0;
  border-radius: 50px 50px 0 0;
}
.border-radius-quarter {
  -webkit-border-radius: 100% 0 0 0;
  border-radius: 100% 0 0 0;
}
</style>
</head>
<body>
<div id="main">
<div class="border-radius-xy box-rectangle-basic box-example"><p>1</p></div>
<div class="border-radius-normal box-rectangle-basic box-example"><p>2</p></div>
<div class="border-radius-round box-square-basic box-example"><p>3</p></div>
<div class="border-radius-halfcircle box-half-basic box-example"><p>4</p></div>
<div class="border-radius-quarter box-square-basic box-example"><p>5</p></div>
</div>
</body>
</html>