html梯形选项卡,梯形选项卡,重叠选项,斜角选项卡,直角梯形

本文介绍了如何在网页中实现VIP特权选项,用户可以通过点击梯形选项1或2,在Type1和Type2内容间切换。通过JavaScript实现动态样式和层级控制,适合前端开发者了解前端交互设计和高级用例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Document

.type2,#pay{

display:none;

}

.vip_content {

width: 929.5px;

border: solid 0.5px #dcdcdc;

border-top: none;

margin: 0 auto;

margin-top: 22px;

margin-bottom: 25px;

border-radius: 5px;

}

.vip_bar {

display: flex;

align-items: center;

position: relative;

height: 54px;

}

.vip_bar .one_option {

font-size: 17px;

letter-spacing: 1.3px;

color: #a1a1a1;

cursor: pointer;

height: 54px;

text-align: center;

display: flex;

align-items: center;

justify-content: center;

border-top: none;

width: 477.5px;

}

.privilege_option {

width: 475px;

z-index: 99;

position: absolute;

left: 0;

top: 0;

}

.num_option {

z-index: 99;

color: #a1a1a1;

position: absolute;

right: 0;

top: 0;

}

.vip_bar .this_option {

color: #3b3127 !important;

z-index: 200;

}

.vip_bar .bg_img {

width: 100%;

height: 100%;

position: absolute;

left: 0;

top: 0;

margin-right: 0;

z-index: -1;

}

.vip_bar img {

width: 17px;

margin-right: 6.5px;

}

.box {

background-color: #fff;

padding: 25px 0;

}

.vip_msg {

width: 855px;

margin: 0 auto;

background-color: #fff;

}

![](https://www.aipinwang.com/static/web/img/zp.png)

![](https://www.aipinwang.com/static/web/img/leftbai.png)

![](https://www.aipinwang.com/static/web/img/zph.png)

![](https://www.aipinwang.com/static/web/img/lefthui.png)

梯形选项1111

![](https://www.aipinwang.com/static/web/img/hrs.jpg)

![](https://www.aipinwang.com/static/web/img/rightbai.png)

![](https://www.aipinwang.com/static/web/img/djh.png)

![](https://www.aipinwang.com/static/web/img/righthui.png)

梯形选项222

梯形选项内容1111
梯形选项内容2222

$(function () {

$(".privilege_option").click(function () {

$(this).addClass("this_option");

$(".num_option").removeClass("this_option");

$(".single").removeClass("single_this");

$(".type1").show();

$(".type2").hide();

$(".privilege_option").css("z-index", 200);

});

$(".num_option").click(function () {

$(this).addClass("this_option");

$(".privilege_option").removeClass("this_option");

$(".type1").hide();

$(".type2").show();

$(".privilege_option").css("z-index", 0);

});

});

### 实现梯形形状的 TabControl 选项卡 #### 在 C# WinForms 中实现 在 WinForms 中,`TabControl` 的样式较为固定,要实现自定义形状如梯形的效果相对复杂。一种方法是继承 `TabControl` 并重写其绘制逻辑。 ```csharp public class CustomShapeTabControl : TabControl { protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; foreach (TabPage tabPage in this.TabPages) { Rectangle rect = GetTabRect(this.SelectedIndex); // 创建路径并添加梯形区域 using(GraphicsPath path = new GraphicsPath()) { int offset = 10; // 梯形偏移量 Point[] points = { new Point(rect.Left, rect.Bottom), new Point(rect.Right - offset, rect.Top), new Point(rect.Right, rect.Top), new Point(rect.Right, rect.Bottom) }; path.AddPolygon(points); // 填充背景颜色 SolidBrush brush = new SolidBrush(tabPage.BackColor); g.FillPath(brush, path); // 绘制边框 Pen pen = new Pen(Color.Black); g.DrawPath(pen, path); } } base.OnPaint(e); } } ``` 此代码片段展示了如何通过覆盖默认绘图行为来创建具有梯形外观的标签页[^1]。 #### 在 C# WPF 中实现 WPF 提供了更为灵活的方式来自定义控件模板,因此更容易实现特殊形状的设计需求: ```xml <TabControl> <TabControl.Resources> <!-- 定义新的 TabItem 样式 --> <Style TargetType="TabItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TabItem"> <Grid> <Path Data="M0,20 L20,0 H80 L100,20 Z" Fill="{Binding Background}" Stroke="Black"/> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Panel.ZIndex" Value="99"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </TabControl.Resources> <TabItem Header="Tab 1">Content of Tab 1</TabItem> <TabItem Header="Tab 2">Content of Tab 2</TabItem> </TabControl> ``` 上述 XAML 片段使用 Path 元素定义了一个简单梯形作为每个 TabItem 的头部,并将其应用到了整个 TabControl 上[^4]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值