0
我試圖在bootstrap中創建按鈕,看起來像。Bootstrop按鈕與中心底部切割
我想這個代碼this鏈接,但它不工作。這是我的代碼。
HTML:
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 cut" >
<div class="cut-bd cut-bd_red">
<div class="cut-hd cut-hd_red">
<button class="btn btn-primary btn-left-bar hdg">Home</button>
</div>
</div>
</div>
這裏是我的CSS代碼:
.cut {
overflow: hidden;
padding: 0 0 30px;
}
.cut-bd {
padding: 15px 15px 0;
position: relative;
}
.cut-hd {
margin: 0 0 5px;
padding: 0 0 5px;
}
.cut-hd_red { border-bottom: 1px solid darken(#e74c3c,5%); }
.cut-hd_green { border-bottom: 1px solid darken(#1abc9c,50%); }
.cut-bd_red {
background: #e74c3c;
color: #ecf0f1;
text-shadow: 1px 1px rgba(#ffffff,.2);
&:before {
content: "";
width: 100%;
height: 30px;
position: absolute;
top: 100%;
right: 30px;
background: #e74c3c;
}
&:after {
content: "";
width: 0;
height: 0;
margin-left: -30px;
position: absolute;
top: 100%;
left: 100%;
border: 15px solid #e74c3c;
border-right: 15px solid transparent;
border-bottom: 15px solid transparent;
}
}
.cut-bd_green {
border-top: 5px solid #ecf0f1;
background: #1abc9c;
color: #ecf0f1;
text-shadow: 1px 1px rgba(#ffffff,.2);
&:before {
content: "";
width: 100%;
height: 30px;
position: absolute;
top: 100%;
right: 30px;
background: #1abc9c;
}
&:after {
content: "";
width: 0;
height: 0;
margin-left: -30px;
position: absolute;
top: 100%;
left: 100%;
border: 15px solid #1abc9c;
border-right: 15px solid transparent;
border-bottom: 15px solid transparent;
}
}
.intro {
color: #ecf0f1;
font-size: 3em;
font-weight: bold;
text-align: center;
text-transform: uppercase;
letter-spacing: 2px;
text-shadow: 3px 3px rgba(darken(#2c3e50,5%),1);
}
.hdg {
color: #ffff;
font-size: 20px;
font-weight: bold;
text-transform: uppercase;
}
請向我提供任何參考或提示。
謝謝你這麼多我想只爲按鈕 –
@SandipArmalPatil更新了我回答,將提供鏈接等待 –
是否有可能從底部切入中心..? –