亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Bootstrap 4 的細長六邊形按鈕

Bootstrap 4 的細長六邊形按鈕

交互式愛情 2023-12-19 21:22:06
如何制作帶有六邊形左側和左側的 Bootstrap 4 按鈕右側,類似于下圖?以下是類似問題的答案,但在 Bootstrap 4 中復制這些樣式(使用正確的 .btn 類)無法正常工作: 僅使用一個元素的細長六邊形按鈕
查看完整描述

1 回答

?
慕村9548890

TA貢獻1884條經驗 獲得超4個贊

請首先理解代碼并根據您的需要更改代碼。


body {

    /* JUST FOR STYLING */

    background-color: #3c93af !important;

}


.custom_btn {

    position: relative;

    display: block;

    background: transparent;

    width: 300px;

    height: 80px;

    line-height: 80px;

    text-align: center;

    font-size: 20px;

    text-decoration: none;

    color: #ffdc01;

    margin: 40px auto;

    font-family: Helvetica, Arial, sans-serif;

    box-sizing: border-box;

}


.custom_btn:hover {

    text-decoration: none;

}


.custom_btn:before,

.custom_btn:after {

    position: absolute;

    content: '';

    width: 300px;

    left: 0px;

    height: 34px;

    z-index: -1;

    box-sizing: content-box;

}


.custom_btn:before {

    transform: perspective(15px) rotateX(3deg);

}


.custom_btn:after {

    top: 40px;

    transform: perspective(15px) rotateX(-3deg);

}


.custom_btn.custom_btn--border:before,

.custom_btn.custom_btn--border:after {

    border: 4px solid #ffdc01;

}


.custom_btn.custom_btn--border:before {

    border-bottom: none;

}


.custom_btn.custom_btn--border:after {

    border-top: none;

}


.custom_btn.custom_btn--border:hover:before,

.custom_btn.custom_btn--border:hover:after {

    background: #ffdc01;

}


.custom_btn.custom_btn--border:hover {

    color: #fff;

}

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">


<a href="#" class="custom_btn custom_btn--border">Click me!</a>


查看完整回答
反對 回復 2023-12-19
  • 1 回答
  • 0 關注
  • 155 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號