circle()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020년 1월.
circle() CSS 함수 는 둥글기와 위치를 이용하여 원 도형을 정의합니다. <basic-shape> 데이터 타입 중 하나입니다.
시도해 보기
clip-path: circle(50px);
clip-path: circle(6rem at right center);
clip-path: circle(10% at 2rem 90%);
clip-path: circle(closest-side at 5rem 6rem);
clip-path: circle(farthest-side);
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element"></div>
</section>
#default-example {
background: #fe9;
}
#example-element {
background: linear-gradient(to bottom right, #f52, #05f);
width: 100%;
height: 100%;
}
구문
css
shape-outside: circle(50%);
clip-path: circle(6rem at 12rem 8rem);
값
<shape-radius>-
<length>나<percentage>혹은closest-side와farthest-side값도 가능합니다.closest-side-
도형의 중심에서 기준 박스의 가장 가까운 면까지의 길이를 사용합니다. 원 도형의 경우에는, 모든 차원에서 가장 가까운 면을 사용합니다.
farthest-side-
도형의 중심에서 기준 박스의 가장 먼 면까지의 길이를 사용합니다. 원 도형의 경우에는, 모든 차원에서 가장 멀리 떨어져 있는 면을 사용합니다.
<position>-
원 도형의 중심을 이동합니다.
<length>,<percentage>혹은left와 같은 형태의 값도 사용할 수 있습니다.<position>값이 생략되는 경우 기본값은 중심입니다.
형식 구문
<circle()> =
circle( <radial-size>? [ at <position> ]? )
<radial-size> =
<radial-extent> |
<length [0,∞]> |
<length-percentage [0,∞]>{2}
<position> =
<position-one> |
<position-two> |
<position-four>
<radial-extent> =
closest-corner |
closest-side |
farthest-corner |
farthest-side
<length-percentage> =
<length> |
<percentage>
<position-one> =
left |
center |
right |
top |
bottom |
x-start |
x-end |
y-start |
y-end |
block-start |
block-end |
inline-start |
inline-end |
<length-percentage>
<position-two> =
[ left | center | right | x-start | x-end ] && [ top | center | bottom | y-start | y-end ] |
[ left | center | right | x-start | x-end | <length-percentage> ] [ top | center | bottom | y-start | y-end | <length-percentage> ] |
[ block-start | center | block-end ] && [ inline-start | center | inline-end ] |
[ start | center | end ]{2}
<position-four> =
[ [ left | right | x-start | x-end ] <length-percentage> ] && [ [ top | bottom | y-start | y-end ] <length-percentage> ] |
[ [ block-start | block-end ] <length-percentage> ] && [ [ inline-start | inline-end ] <length-percentage> ] |
[ [ start | end ] <length-percentage> ]{2}
예제
>기본 원 도형
아래 예제에서는 shape-outside 속성은 주변으로 흐르는 텍스트 위에 띄워진 형태로 circle(50%) 값을 가진 원 도형을 정의합니다.
명세서
| Specification |
|---|
| CSS Shapes Module Level 1> # funcdef-basic-shape-circle> |
브라우저 호환성
Loading…
같이 보기
- 이 데이터 타입을 사용하는 속성들:
clip-path,shape-outside - 기본 도형 가이드