I'm working on a little personal website project and slowly improving my terrible skills. I've got my site to a point I'm happy with although on mobile (iOS Safari), when I expand my hamburger menu, it won't collapse again upon touching the button or the rest of the screen. Can't seem to get around it. Any advice would be great.
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<!--fonts-->
<link href='http://fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'>
<!--//fonts-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!-- for-mobile-apps -->
<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Personal Website" />
<!-- //for-mobile-apps -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>
<body>
<header>
<a class="navbar-brand" href="index.html" id="logo"></a>
<nav>
<a href="#" id="menu-icon" input type="checkbox"></a>
<ul>
<li><a href="#about">ABOUT</a></li>
<li><a href="#">WORK</a></li>
<li><a href="#">BLOG</a></li>
<li><a href="#">CONTACT</a></li>
</ul>
</nav>
</header>
CSS:
/*RESET*/
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline; background:transparent;} body {line-height: 1;}ol, ul{list-style:none;} blockquote, q{quotes:none;} blockquote:before, blockquote:after, q:before, q:after{content:'';content:none;} :focus{outline:0;} ins{text-decoration:none;} del{text-decoration:line-through;} table{border-collapse:collapse; border-spacing:0;}
/*MAIN*/
body {
font-size: 1.05em;
line-height: 1.25em;
font-family: Helvetica Neue, Helvetica, Arial;
background: #f9f9f9;
color: #444;
}
h1,h2,h3 {
font-family: 'Raleway', sans-serif;
}
a {
color: #414141;
text-decoration: none;
font-weight: 300;
}
a:hover {
color: #000;
font-weight: 500;
text-decoration: none;
}
img {
width: 100%;
}
header {
background-color: rgba(255,255,255,0.95);
width: 100%;
height: 79px;
position: fixed;
top: 0;
left: 0;
border-bottom: 4px solid #515151;
z-index: 100;
}
#logo{
margin: 5px 0 10px 25px;
float: left;
width: 65px;
height: 65px;
background: url(../images/db_logo_clean_60.png) no-repeat center;
display: block;
}
nav {
float: right;
padding: 20px;
}
#menu-icon {
display: hidden;
width: 40px;
height: 40px;
background: #515151 url(../images/menu-icon.png) center;
}
a:hover#menu-icon {
background-color: #000;
border-radius: 4px 4px 0 0;
}
ul {
list-style: none;
}
li {
display: inline-block;
float: left;
padding: 10px
}
.current {
color: #515151;
}
section {
margin: 80px auto 40px;
max-width: 980px;
position: relative;
padding: 20px
}
/*--banner--*/
.banner{
background: url(../images/1172.png) no-repeat 0px 0px;
background-size: 100% 100%;
-webkit-background-size: 100% 100%;
-moz-background-size: 100% 100%;
-o-background-size: 100% 100%;
text-align: center;
min-height:800px;
}
.banner-info{
width:70%;
margin: 200px auto 0 auto;
}
.banner-right h1{
font-size:36px;
font-weight:800;
color:#414141;
margin:35px 0 15px 0;
letter-spacing: 15px;
}
.banner-right h2{
font-size: 40px;
font-weight: 300;
color: #313131;
margin: 15px 0 45px 0;
}
.banner-right p{
text-decoration:none;
color:#414141;
font-size:16px;
font-weight:500;
padding:16px 20px;
border:2px solid #414141;
}
.banner-left{
float:left;
}
.banner-right{
float:right;
}
h1 {
font-size: 2em;
color: #2262AD;
line-height: 1.15em;
margin: 20px 0 ;
}
p {
line-height: 1.45em;
margin-bottom: 20px;
}
.about {
padding: 60px 0 25px 0;
}
.about h3 {
margin:0;
color:#414141;
font-size:36px;
font-weight:500;
letter-spacing: 16px;
}
.about p {
margin: 60px 100px 0 100px;
}
.contact {
padding: 60px 0 25px 0;
}
.contact h3 {
margin:0;
color:#414141;
font-size:36px;
font-weight:500;
letter-spacing: 16px;
}
.contact p {
margin: 60px 100px 0 100px;
}
/*MEDIA QUERY*/
@media only screen and (max-width : 1200px) {
.banner-info {
width: 87%;
margin: 180px auto 0 auto;
}
}
@media only screen and (max-width : 1000px) {
.banner-info{
display: inline-block;
vertical-align: middle;
}
.banner-left {
margin: 0 20px 0 0;
width: 25%;
}
.banner-right {
width: 70%;
}
.banner-right h1 {
font-size: 30px;
}
.banner-right h2 {
font-size: 36px;
}
.banner-right p {
font-size: 14px;
}
}
@media only screen and (max-width : 1000px) {
.banner {
min-height: 700px;
}
}
@media only screen and (max-width : 640px) {
header {
position: absolute;
}
#menu-icon {
display:inline-block;
}
nav ul, nav:active ul {
display: none;
position: absolute;
padding: 20px;
background: #fff;
border: 5px solid #444;
right: 20px;
top: 60px;
width: 50%;
border-radius: 4px 0 4px 4px;
}
nav li {
text-align: center;
width: 100%;
padding: 10px 0;
margin: 0;
}
nav:hover ul {
display: block;
}
.banner-info{
margin-top: 140px;
display: inline-block;
vertical-align: middle;
}
.banner-left{
float: none;
margin: 0 auto;
width: 35%;
vertical-align: middle;
}
.banner-right{
float: none;
margin: 0 auto;
vertical-align: middle;
}
.about p {
margin: 50px 50px 0 50px;
}
}
@media only screen and (max-width : 340px) {
.about h3 {
font-size: 28px;
}
.about p {
margin: 25px 25px 0 25px;
}
}