gpt4 book ai didi

html - 倒梯形导航

转载 作者:行者123 更新时间:2023-11-28 02:46:32 24 4
gpt4 key购买 nike

我想制作一个倒置的梯形,我想用作导航栏。

类似于这张图片:

最佳答案

你可以试试这个

.nav>li>a, .nav>li>a:active, .nav>li>a:focus, .nav>li>a:hover {
display: inline-block!important;
position: relative!important;
color: #fff;
text-transform: uppercase;
margin-left: 60px;
box-shadow: 0px 4px 3px rgba(0,0,0,0.3);
padding: 0!important;
text-shadow:1px 1px 1px rgba(0,0,0,0.5);
}
.nav li a span {
display: inline-block;
position: relative;
padding: 15px 40px;
background: #ea9c0c;
}

.nav li a:after{
content:"";
width: 0;
height: 0;
border-top: 100px solid red;
border-right: 100px solid transparent;
}

.nav li a:after {
content: "";
width: 0;
height: 0;
border-top: 50px solid #ea9c0c;
border-right: 47px solid transparent;
position: absolute;
top: 0;
right: -47px;
z-index: 1;
}

.nav li a:before {
content: "";
width: 0;
height: 0;
border-top: 50px solid #ea9c0c;
border-left: 47px solid transparent;
position: absolute;
top: 0;
left: -47px;
z-index: 1;
}

.nav li a span:after {
content: "";
width: 0;
height: 0;
border-top: 50px solid rgba(0,0,0,0.3);
border-right: 47px solid transparent;
position: absolute;
top: 4px;
right: -47px;
}

.nav li a span:before {
content: "";
width: 0;
height: 0;
border-top: 50px solid rgba(0,0,0,0.3);
border-left: 47px solid transparent;
position: absolute;
top: 4px;
left: -47px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<ul class="nav">
<li><a href="#"><span>Home</span></a></li>
</ul>

关于html - 倒梯形导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46902414/

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