border-radius로 한쪽 모서리 비스듬하게 만들기

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
border-radius로 한쪽 모서리 비스듬하게 만들기

QA

border-radius로 한쪽 모서리 비스듬하게 만들기

본문

1889326059_1704941976.2832.png

 

안녕하세요, border-radius 속성으로 한쪽 모서리가 들어간 디자인을 하려고하는데 이걸 어떻게 하는건지 잘 모르겠습니다...ㅠㅠ 알고 계시는 고수님들 계실까요?

이 질문에 댓글 쓰기 :

답변 5

다음 코드가 도움이 될지 모르겠습니다.


<style>
:root {
    --v-shape-00-tp: 25%;
    --v-shape-00-ratio: 0.5;
    --v-shape-00-width: 300px;
    --v-shape-00-height: calc(var(--v-shape-00-width) * var(--v-shape-00-ratio));
    --v-shape-00-border: 5px;
    --v-shape-00-bgcolor: #fff;
}
.tmpl_wrapper {
    background-color: var(--v-shape-00-bgcolor);
}
.tmpl_shape_00, .tmpl_shape_00 > div {
    position: relative;
    width: var(--v-shape-00-width);
    height: var(--v-shape-00-height);
    background-color: #555;
    clip-path: polygon(calc(
        var(--v-shape-00-tp) * var(--v-shape-00-ratio)
    ) 0%, 100% 0%, 100% 100%, 0% 100%, 0% var(--v-shape-00-tp));
}
.tmpl_shape_00 > div {
    position: absolute;
    top: var(--v-shape-00-border);
    left: var(--v-shape-00-border);
    content: '';
    background-color: var(--v-shape-00-bgcolor);
    width: calc(var(--v-shape-00-width) - var(--v-shape-00-border) * 2);
    height: calc(var(--v-shape-00-height) - var(--v-shape-00-border) * 2);
}
</style>
 
<div class="tmpl_wrapper">
    <div class="tmpl_shape_00">
        <div>this is a text</div>
    </div>
</div>

안녕하세요.

아래의 내용을 참고해 보시겠어요~

 

<!DOCTYPE html>

<html>

<head>

<style>

.box {

width: 200px;

height: 200px;

background-color: #f00;

border-radius: 25px 0 0 0;

}

</style>

</head>

<body>

<div class="box"></div>

</body>

</html>

 

 

 

답변을 작성하시기 전에 로그인 해주세요.
전체 124 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT