Interesting CSS shape navigation (chevrons)

白昼怎懂夜的黑 提交于 2019-12-03 09:13:29

Add a negative margin to each arrow:

.navArrow {
  float: left;
  margin-left: -8px;
}

Demo: http://jsfiddle.net/S7hzu/2/

Flexbox

You can use this example

https://codepen.io/WBear/pen/pPYrwo

it works on new browsers, to support old ones some changes needed.

HTML:

<div class="content">
<div class="as1">
  <a href="#">NAV</a>
  </div>
 <div class="as2">
   <a href="#">NAV</a>
   </div>
  <div class="as3">
   <a href="#">NAV</a>
   </div>
  </div>

CSS:

 .content {
  margin-top: 10px;
  width: 100%;
  display: inline-flex;

}

.as1, .as2, .as3 {
  height: 70px;
  min-width: 8%;
  max-width: 100%;
  background-color: black;
  position: relative;
  display: inline-flex;
  text-align: center;
  flex-wrap: wrap;
  flex-grow: 1;

}

.as1 a, .as2 a, .as3 a {
  text-decoration: none;
  display: inline-flex;
  color: white;
  margin: auto;
  font-size: 14pt;

}

.as1:after {
  content: "";
  position: absolute;
  right: 4px;
  border-top: 35px solid transparent;
  border-left: 25px solid black;
  border-bottom: 35px solid transparent;
  z-index: 2;

}

.as2 {
  background-color: grey;
  margin-left: -29px;


}
.as2:after {
  content: "";
  position: absolute;
  right: 4px;
  border-top: 35px solid transparent;
  border-left: 25px solid grey;
  border-bottom: 35px solid transparent;
  z-index: 3;

}

.as3 {
  background-color: #A9A9A9;
  margin-left: -29px;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!