2017-04-07 52 views
2

我想在我的引導面板上使用圓角。但是,當我將外部div設置爲具有圓角時,它們將被panel-body和panel-header用它們的3px角覆蓋。我如何覆蓋這個,即停止設置角落的身體/頭部,而不是爲每個身體和頭部設置所有四個角?引導拐角半徑覆蓋我的外部div面板角

我定身的背景是藍色第一的ligher陰影,太:

.panel-body { 
    background: #d9edf7; 
} 

下面是HTML

<div class="panel-group"> 
    <div class="panel panel-info" style="-moz-border-radius: 12px; 
    -webkit-border-radius: 12px; 
    -ie-border-radius: 12px; 
    -opera-border-radius: 12px; 
    -chrome-border-radius: 12px; 
    border-radius: 12px;"> 
     <div class="panel-heading"><h2>Don't have an account?</h2></div> 
     <div class="panel-body"> 
         register here! 
     </div> 
    </div> 
</div> 

感謝。

回答

2

添加overflow: hidden

.panel-body { 
 
    background: #d9edf7; 
 
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/> 
 
<div class="panel-group"> 
 
    <div class="panel panel-info" style="-moz-border-radius: 12px; 
 
    -webkit-border-radius: 12px; 
 
    -ie-border-radius: 12px; 
 
    -opera-border-radius: 12px; 
 
    -chrome-border-radius: 12px; 
 
    border-radius: 12px; overflow: hidden;"> 
 
     <div class="panel-heading"><h2>Don't have an account?</h2></div> 
 
     <div class="panel-body"> 
 
         register here! 
 
     </div> 
 
    </div> 
 
</div>

+1

感謝。輝煌。我似乎不得不這樣做 溢出:隱藏; z-index:3; 讓它正常工作。 –