单击元素下方的透明箭头

时间:2015-01-14 11:10:46

标签: html css transparent

当链接为“.active”

时,我无法弄清楚如何使这个透明箭头工作

我在导航下面创建了一个条形图,因此箭头可以是透明的背景,但我不知道当你点击它时如何使它成为“.active”链接下面的任何想法以使透明箭头工作并在被点击的元素下面?

jsfiddle(请将屏幕设置得更大,因为它有媒体查询)

HTML

body {
  background-image: url("http://www.crystalxp.net/galerie/img/th_13740.jpg");
}
#logo {
  padding: 10px;
  max-width: 210px;
  display: inline-block;
  margin: 5px auto 0 auto;
}
@media (min-width: 720px) {
  #logo {
    display: block;
    float: left;
    height: 54px;
    max-width: auto;
    width: 210px;
    margin: 0px 5px 5px 5px;
    padding: 0;
  }
}
// header container
 .header-container {
  width: 100%;
  background-color: #252525;
  background-color: rgba(37, 37, 37, 0.97);
  z-index: 2;
  -webkit-box-shadow: 0 1px 4px 0 rgba(100, 100, 100, 0.7);
  -moz-box-shadow: 0 1px 4px 0 rgba(100, 100, 100, 0.7);
  box-shadow: 0 1px 4px 0 rgba(100, 100, 100, 0.7);
}
.nav-actions {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
  float: right;
}
@media (min-width: 720px) {
  .nav-actions {
    display: block;
  }
}
.nav-actions li {
  float: left;
}
@media (min-width: 720px) {
  .nav-actions li {
    margin-left: 10px;
  }
}
@media (min-width: 960px) {
  .nav-actions li {
    margin-left: 20px;
  }
}
.nav-actions li a:link,
.nav-actions li a:visited {
  padding: 4px 20px;
  display: block;
  margin-top: 13px;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  color: #e49e02;
  border: 2px solid #e49e02;
}
.nav-actions li a:hover,
.nav-actions li a:active {
  border: 2px solid #ffffff;
  color: #ffffff;
}
.nav-actions li a.active {
  text-decoration: underline;
}
.nav-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
  overflow: hidden;
  display: block;
  margin: 0;
  float: left;
  padding: 0 0 0 0px;
  display: none;
}
.nav-list li {
  display: block;
  float: left;
  margin: 0;
}
.nav-list li:last-child {
  margin-right: 0px;
}
@media (min-width: 720px) {
  .nav-list {
    display: block;
  }
}
.nav-list li {
  float: left;
}
.nav-list li a:link,
.nav-list li a:visited {
  display: block;
  color: #e49e02;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
}
@media (min-width: 720px) {
  .nav-list li a:link,
  .nav-list li a:visited {
    padding: 15px 10px;
    font-size: 0.85em;
  }
}
@media (min-width: 960px) {
  .nav-list li a:link,
  .nav-list li a:visited {
    padding: 15px 30px;
    font-size: 1.3em;
  }
}
.nav-list li a:hover,
.nav-list li a:active {
  color: #ffffff;
}
.nav-list li a.active {
  color: red;
}
.nav-list li a.active:after,
.nav-list li a.active:before {
  content: '';
  position: absolute;
  top: 62px;
  width: 56%;
  padding-bottom: inherit;
  background-color: rgba(37, 37, 37, 0.97);
}
.nav-list li a.active:before {
  right: 49%;
  -ms-transform-origin: 100% 100%;
  -webkit-transform-origin: 100% 100%;
  transform-origin: 100% 100%;
  -ms-transform: skewX(-45deg);
  -webkit-transform: skewX(-45deg);
  transform: skewX(-45deg);
}
.nav-list li a.active:after {
  left: 53%;
  -ms-transform-origin: 0 100%;
  -webkit-transform-origin: 0 100%;
  transform-origin: 0 100%;
  -ms-transform: skewX(45deg);
  -webkit-transform: skewX(45deg);
  transform: skewX(45deg);
}
<!--- header container --->
<header class="header-container">
  <div class="header-container--inner">
    <!--- site logo --->
    <a href="/">
      <img id="logo" src="http://placehold.it/100x50">
    </a>
    <!--- main nav --->
    <ul class="nav-list">
      <li><a href="/entries">entries</a>
      </li>
      <li><a class="" href="">event</a>
      </li>
      <li><a class="active" href="">store</a>
      </li>
      <li><a href="">archive</a>
      </li>
    </ul>
    <!--- main nav actions --->
    <ul class="nav-actions">
      <li><a href="/entries">enter</a>
      </li>
    </ul>
    <!--- mobile nav link  --->
    <div class="small-navigation">
      <a href="">
        <i class="fa fa-bars"></i>
      </a>
    </div>
  </div>
</header>

<!--- main wrapper --->
<div class="main-wrapper">
  <!--- main container --->
  <div class="main-container">

0 个答案:

没有答案