My CSS navigation menu isn't functioning in IE11, although it works perfectly in Chrome and Firefox. The menu is purely CSS-based with no JavaScript involved. I've tried playing around with doctype declarations but haven't been able to resolve the issue.
Can someone please help me figure out what I might be overlooking?
nav ul {
margin-top:1px; /* tucks the child ul up close to the parent li */
border-color: blue;
border-width: 10px;
border-style: solid;
width: 200px;
overflow: hidden;
}
nav li {
list-style-type: none;
border-color: aqua;
border-width: 10px;
border-style: solid;
}
nav ul li {
display: none;
border-color: lime;
border-width: 10px;
border-style: solid;
margin:1px;
margin-top:-10px;
margin-left:-10px;
}
nav {
background-color: #c8b99c; /* pale brown */
width: 220px;
margin-left:auto;
margin-right: auto;
}
nav ul li.selected {
background-color: #c18946;
}
nav li a { /* to make the whole box clickable, not just the link text */
display:block; /* <<< this is the bit that does it */
line-height:23px;
text-decoration:none;
border-color: red;
border-width: 3px;
border-style: solid;
}
nav li:focus-within ul li {
display: block;
}
<!doctype html>
<html lang="en">
<head>
<title>My Webpage</title>
<link type="text/css" rel="stylesheet" href="nav_style.css">
</head>
<body>
<nav>
<li tabindex="1"><a href="#" tabindex="-1">Home</a>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Skeleton Page 1</a></li>
<li><a href="#">Skeleton Page 2</a></li>
</ul>
</li>
<li tabindex="1"><a href="#" tabindex="-1">Home</a>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Skeleton Page 1</a></li>
<li><a href="#">Skeleton Page 2</a></li>
</ul>
</li>
</nav>
</body>
</html>