html.de - CSS-Menü - IE-Workaround

by SpiceLab

HTML

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<div id="main">
  <nav role="navigation" id="nav">
    <input class="trigger" type="checkbox" id="mainNavButton">
    <label for="mainNavButton" onclick>Menu</label>
    <ul>
      <li><a href="#"><span>Link 1</span></a></li>
      <li><a href="#"><span>Link 2</span></a>
      <li><a href="#"><span>Link 3</span></a></li>
      <li><a href="#"><span>Link 4</span></a></li>
    </ul>
  </nav>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, dignissimos, distinctio 
     consequatur eos optio recusandae maiores quidem possimus tempora esse reiciendis velit ut 
     consequuntur architecto hic soluta deleniti fugit explicabo.</p>
 </div>

CSS

body {
  margin: 25px;
  -webkit-animation: bugfix infinite 1s;
  /* needed for checkbox hack */
  background: #021320;
}

@-webkit-keyframes bugfix {
  from {
    padding: 0;
  }
  to {
    padding: 0;
  }
}
/* needed for checkbox hack */
h1, p {
  color: white;
}
#main {
   width:80%;
   margin: 0;
}
#nav {
  position: relative;
}
#nav ul {
  display: none;
  width: 100%;
  list-style: none;
  margin: 0px;
  padding: 0px;
}
#nav ul li a {
    display: flex; /* wie in MrMurphys Beispiel - anstatt display: block */
    justify-content: center; /* Ergänzung, damit flexible Elemente mittig angeordnet werden */
    padding: 0.2em;
    margin: 0.2em;
    background: #0F9962;
    color: white;
    text-decoration: none;
    border-right: 1px solid #0a6b44;
    font-weight: bold;
    transform: skew(-45deg);
    /* IE8+ - must be on one line, unfortunately */ 
   -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=-0.9999999999999977, M21=-0.9999999999999977, M22=1, SizingMethod='auto expand')";
   
    position: relative; /* absolute top-/left-Startpositionen von ::before u. ::after beziehen sich auf <a> */
}
#nav ul li:first-child a::before,
#nav ul li:last-child a::after {
    content: "";
    /*background-color: rgba(255, 255, 0, .5);*/ /* nur zu Demozwecken; wieder auf #0F9962 zurücksetzen */
    background-color:  #0F9962;
    position: absolute;
    z-index: -1; /* nur zu Demozwecken auf "10"; wieder auf "-1" zurücksetzen */
    transform: skew(45deg);
    /* IE8+ - must be on one line, unfortunately */ 
   -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1, M12=1.0000000000000004, M21=1.0000000000000004, M22=1, SizingMethod='auto expand')";
   
    width: 2em;
    height: 100%;
    top: 0;
    left: -.8em;
}
#nav ul li:last-child a::after {
    left: calc(100% - 1.2em);
}
#nav ul li a span {
  transform: skew(45deg);
  /* IE8+ - must be on one line, unfortunately */ 
   -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=1,...