0
내 웹 사이트의 모서리 2 개로 경계를 만들고 싶습니다. 다른 div 크기에이 경계선이 필요합니다.모서리가 두 개인 모서리로 만들기
한 시간 정도 지나면 고정 된 크기의 200px로 작동하게되었습니다. 그러나 나는 이것이 어떻게 유연하게 할 수 있는지 모른다.
여기
body {background: #000;}
#outer {
width: 200px;
height: 200px;
position: relative;
margin: 0 auto;
margin-top: 50px;
background: #0ff;
}
#outer:before {
content: "";
height: 200px;
left: -15px;
position: absolute;
border-top: 15px solid transparent;
border-right: 15px solid #fff;
}
#outer:after {
content: "";
width: 200px;
height: 200px;
top: -15px;
right: -215px;
position: absolute;
border-left: 15px solid #fff;
border-bottom: 15px solid transparent;
}
#outer span {
width: 200px;
height: 200px;
position: absolute;
padding: 50px;
}
#outer span:before {
display: block;
content: "";
width: 200px;
top: -15px;
left: 0;
position: absolute;
border-bottom: 15px solid #fff;
border-left: 15px solid transparent;
}
#outer span:after {
display: block;
content: "";
width: 200px;
height: 200px;
top: 200px;
left: -15px;
position: absolute;
border-top: 15px solid #fff;
border-right: 15px solid transparent;
}
누구나 더 나은 해결책을 알고있는 Demo
HTML
<div id="outer"><span>Some Text</span></div>
CSS입니까? 감사합니다
는 모서리가 진정으로 투명해야하거나 배경과 같은 색이 될 수있는 일 ? –
전체 화면 배경 이미지가 있기 때문에 진정으로 투명 해집니다. – tryzor