2012-05-11 6 views

답변

5

예, 추가 마크 업없이이 작업을 수행 할 수 있습니다. 다음과 같이 쓰기 :

CSS

.active{ 
    border:1px solid red; 
    border-bottom:0; 
    width:80px; 
    height:40px; 
    margin:30px; 
    position:relative; 
    -moz-border-radius:5px 5px 0 0; 
    -webkit-border-radius:5px 5px 0 0; 
    border-radius: 5px 5px 0 0; 
} 
.active:after, 
.active:before{ 
    content:''; 
    width:40px; 
    height:30px; 
    border:1px solid red; 
    position:absolute; 
    bottom:-3px; 
    border-top:0; 
} 
.active:after{ 
    border-left:0; 
    -moz-border-radius:0 0 5px 0; 
    -webkit-border-radius:0 0 5px 0; 
    border-radius: 0 0 5px 0; 
    left:-41px; 
} 
.active:before{ 
    border-right:0; 
    -moz-border-radius:0 0 0 5px; 
    -webkit-border-radius:0 0 0 5px; 
    border-radius: 0 0 0 5px; 
    right:-41px; 
} 

HTML

<div class="active">hi</div> 

확인 그래픽의 일부가 외부에 있기 때문에이 추가 마크 업없이 할 수 없습니다이 http://jsfiddle.net/p6sGJ/

+0

"진짜"'border-radius' 속성을 추가하는 것을 잊었습니다. 우리는이 미친 짓을 더 이상 원하지 않습니다 : http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/ – peirix

+0

그것은 좋지만 단지 예제를 제공합니다 - 웹킷 & mozilla 브라우저 : – sandeep

+1

그래, 문제는 누군가가 아마 코드를 복사 해 넣을 것이고 그게 처음부터 문제가 시작된 방법 일 것입니다. 그래서 저는 방금 당신의 대답에 대한 빠른 편집을했습니다. 그것은 좋은 해결책입니다. 그래서 우리는 가능한 한 많이 이것을 피하려고 노력할 수 있습니다. – peirix

관련 문제