2017-03-15 9 views
-1

4 개의 행이있는 사이드 바를 스케치하여 디자인했습니다. 각 테두리는 테두리로 구분됩니다.테두리가 상자에 맞춰 짐

나는 이것들과 같은 테두리를 얻을 수 있는지 알고 싶습니다.

내 디자인 사진을 첨부 했으므로 정확히 무슨 뜻인지 알 수있었습니다.

enter image description here

+2

뿐만 아니라'HTML'와'CSS'를 추가하십시오. –

답변

1

U는 CSS의 :after 요소를 처리 할 수 ​​있습니다.

여기에 예를 들어

.demo:after { 
    content:""; 
    position: absolute; 
    z-index: -1; 
    top: 2rem; 
    bottom: 0; 
    left: 50%; 
    border-left: 2px solid #000; 
    height:30px; 
} 
0

입니다이 시도 :

div { 
    width: 200px; 
    height: 100px; 
    background: #BB67E0; 
    position: relative; 
    margin: 50px; 
    text-align: center; 
    line-height: 100px; 
    font-size:30px; 
    color:#fff; 
} 
div:after { 
    position: absolute; 
    content: ""; 
    width: 2px; 
    height: 80px; 
    background: black; 
    left: -10px; 
    top: 10px; 
    box-shadow: 220px 0 0 0 black; 
} 
div:before { 
    position: absolute; 
    content: ""; 
    height: 2px; 
    width: 180px; 
    background: black; 
    left: 10px; 
    top: -10px; 
    box-shadow: 0 120px 0 0 black; 
} 

HTML :

<div>content div</div>