모양을 복제하려고합니다
CSS에서 둥근 모양을 사용하면 약간 다르게 보입니다.
.shape{
display: inline-block;
text-align: center;
line-height: 18px;
border-radius: 9px 9px 9px 9px;
color: #000000;
padding-left: 6px;
padding-right: 6px;
font-weight: bold;
font-family: sans-serif;
}
.shape.orange{
background-color: #FF931B;
}
<span class="shape orange">CC6</span>
올바른 모양을 얻으려면 어떻게해야합니까?
이것은 다음을 사용하여 수행 할 수 있습니다. radial-gradient
.shape{
display: inline-block;
font-size:50px;
line-height:1.5em;
padding:0 0.4em;
font-weight: bold;
font-family: sans-serif;
background:
radial-gradient(100% 50% at right, #FF931B 98%,transparent 100%) left,
radial-gradient(100% 50% at left , #FF931B 98%,transparent 100%) right,
#FF931B content-box; /*Don't color the padding to keep it for radial-gradient*/
background-size:0.4em 100%; /* Width same as padding and height 100%*/
background-repeat:no-repeat;
}
<span class="shape">CC6</span>
<span class="shape" style="font-size:70px">CC6</span>
<span class="shape" style="font-size:15px">CC6</span>
또는 border-radius
아래와 같이 :
.shape{
display: inline-block;
font-size:50px;
line-height:1.5em;
padding:0 0.4em;
font-weight: bold;
font-family: sans-serif;
background: #FF931B;
border-radius:0.4em/50%;
}
<span class="shape">CC6</span>
<span class="shape" style="font-size:70px">CC6</span>
<span class="shape" style="font-size:15px">CC6</span>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다