gpt4 book ai didi

html - 中间 Angular 左右双按钮

转载 作者:搜寻专家 更新时间:2023-10-31 22:37:44 27 4
gpt4 key购买 nike

查看此图片

Facebook Messenger Android App Buttons ( MESSENGER\ACTIVE )

我怎样才能做到这一点?

详细信息:-

带有 2px 红色边框的 div。该 div 包含 2 个带有内联 block 的按钮。一个在左侧,另一个在 DIV 的右侧。喜欢:[BUTTON1][BUTTON2]但我想要这个:- [BUTTON1\BUTTON2]两个按钮之间的斜杠样式形状。

我试过了

#M_Left {
width: 0;
height: 0;
margin: 0 !important;
padding: 0 !important;
display: inline-block;
border-top: 100px solid #3fc2ff;
border-right: 50px solid transparent;
border-left: 400px solid #3fc2ff;
color: #fff;
text-align: center;
}

#M_Right {
width: 0;
height: 0;
margin-left: -40;
border-bottom: 100px solid #3fc2ff;
display: inline-block;
border-right: 400px solid #3fc2ff;
border-left: 50px solid transparent;
color: #fff;
text-align: center !important;
}

.white_M {
margin: 0 !important;
padding: 0 !important;
height: 0 !important;
display: inline-block;
min-width: 400px;
border-width: 0 !important;
border-style: none !important;
color: #3fc2ff !important;
}

.M_Container {
margin: 0 !important;
padding: 0 !important;
width: auto !important;
display: inline-block;
border: 2px solid #3fc2ff;
}
<div class="M_Container">
<div id="M_Left"> HEY</div>
<div id="M_Right" class="white_Mx"> </div>
</div>

请帮帮我提前谢谢你

最佳答案

您可以使用以下方法创建它

$('button').click(function() {
$(this).addClass('current').siblings().removeClass('current');
});
.buttonGroup {
display: flex;
border: 1px solid skyblue;
/* Border color change as your need */
overflow: hidden;
border-radius: 5px;
max-width: 350px;
}

button {
flex: 1;
background: none;
border: none;
outline: none;
padding: 5px;
cursor: pointer;
position: relative;
}

button:hover:before {
background: skyblue;
}

button:hover:after {
background: skyblue;
}

button.current:before {
background: skyblue;
}

button.current:after {
background: skyblue;
}

button:before {
content: '';
width: 100%;
height: 100%;
background: #fff;
position: absolute;
transform: skewX(-25deg);
left: -5px;
top: 0;
z-index: -1;
}

button:after {
content: '';
width: 100%;
height: 100%;
background: #fff;
position: absolute;
transform: skewX(-25deg);
right: -5px;
top: 0;
z-index: -1;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="buttonGroup">
<button>Hello</button>
<button>Bye</button>
</div>

关于html - 中间 Angular 左右双按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45052120/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com