-1
<!DOCTYPE html>
<html>
  <head></head>
  <body>
    
   <header class="header">
        <h1 class="logo"><a href="#">Our Wedding</a></h1>
      <ul class="main-nav">
          <li><a href="#">Our Story</a></li>
          <li><a href="#">Annoncements</a></li>
          <li><a href="#">Travel & Stay</a></li>
      </ul>
   </header> 
    
  </body>
</html>
body {
    font-family: Arizonia;
  line-height: 1.6;
    margin: 0;
}
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
    color: #34495e;
  text-decoration: none;
}

.logo {
  margin: 0;
    font-size: 1.45em;
  text-align: center;
}

.main-nav {
    margin-top: 5px;
}

.logo a,
.main-nav a {
    padding: 10px 15px;
    text-transform: uppercase;

    display: block;
}

.main-nav a {
    color: #34495e;
    font-size: .99em;
  
}

.main-nav a:hover {
    color: #718daa;
}

.header {
    padding-top: .5em;
    padding-bottom: .5em;
    border: 1px solid #a2a2a2;
    background-color: #f4f4f4;
    -webkit-box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
    -moz-box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
    box-shadow: 0px 0px 14px 0px rgba(0,0,0,0.75);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
}

how do I make the menu bar on the left side a drop down menu, so that with a click of a button the menu bar on the left side of the website will drop down how it displays now and clicking it a second time would suck up the tabs that are displaying now? Im not sure if that makes sense but I can try and re word what I want if people don't understand.

1 Answers1

2

Do you want something like this?

HTML:

<head>
    <link rel="stylesheet" href="style.css">
    <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
</head>

<body>

<header class="header">
    <h1 class="logo"><a href="#">Our Wedding</a></h1>
    <ul class="main-nav">
        <li><a href="#">Our Story</a></li>
        <li><a href="#">Annoncements</a></li>
        <li><a href="#">Travel & Stay</a></li>
    </ul>
</header>
<script>
    $(document).ready(function() {
        $(".logo").click(function () {
            $(".main-nav").toggle();
        })
    });
</script>
</body>
</html>

CSS:

.main-nav {
    margin-top: 5px;
    display: none;
}
s2k
  • 31
  • 3