Having trouble making my nav bar collapse and expand with screen size. The code I'm using isn't working, and I can't pinpoint the issue.
I'd like the nav bar to transition into a menu icon when the screen reaches a tablet-like size. Currently, the nav links behave in an unexpected manner when the screen is resized.
Please view the code snippet below:
*{
margin: 0;
padding: 0;
line-height: 1;
}
body {
margin: 0;
font-family: sans-serif;
background: #FFFFFF;
-webkit-font-smoothing: antialiased;
overflow: hidden;
overflow-x: hidden;
}
nav {
margin: 0 0 0 0;
font-family: 'Lato', Sans-serif;
font-size: 100%;
width: auto;
}
.navbar {
margin: 0;
padding-top: 1.5em;
padding-bottom: 1.5em;
padding-left: 6em;
padding-right: 5.06em;
background-color: #000;
}
.navbar-brand {
color: #fff;
background-color: #000;
font-size: 22px;
display: inline;
}
.navbar ul li {
display: inline;
}
.navbar ul li a {
color: #fff;
background-color: #000;
font-size: 18px;
}
.nav-link {
padding-left: 15px;
padding-right: 15px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="HandheldFriendly" content="true">
<link href="graphic-design.css" type="text/css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,900" rel="stylesheet">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js" integrity="sha384-feJI7QwhOS+hwpX2zkaeJQjeiwlhOP+SdQDqhgvvo1DsjtiSQByFdThsxO669S2D" crossorigin="anonymous"></script>
<script type="text/javascript"></script>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<a class="logo"><img src="9haus-logo-white.png" alt="9haus logo" width="63px" height="19px"></a>
<a class="navbar-brand" href="graphic-design.html">Graphic design</a>
<div class="navs">
<ul class="navbar-brand">
<li class="active"><a class="nav-link" href="graphic-design.html">Work</a></li>
<li><a class="nav-link" href="graphic-studio.html">Studio</a></li>
<li><a class="nav-link" href="#">Services</a></li>
</ul>
</div>
</div>
</nav>
</body>
</html>