jquery - Why is this DIV duplicating? -


i having trouble getting banner image underneath nab bar fit right , respond screen width. seems div using set banner background image duplicated or here screen shot...

duplicate div pic

this same image twice.

here code:

<!doctype html>  <html>  	<head>      <title>vector games</title>      <meta charset="utf-8"/>      <link rel="shortcut icon" href="favicon.png" />      <link rel="stylesheet" type="text/css" href="homecss.css">      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>      <head>      <style>  body{  	margin: 0;  	padding: 0;  	font-family: sans-serif;  }  header{  	background-image: url('cubes.png');  	width: 100%;  	padding: 15px 0;  	color: #49ac6f;  	text-align: center;  	font-size: 20px;  }  a{  	text-decoration: none;  	color: inherit;  }  nav ul{  	background-color: #a2a2a2;  	overflow: hidden;  	color: white;  	padding: 0;  	text-align: center;  	margin: 0;  	-webkit-transition: max-height .4s;  	-ms-transition: max-height .4s;  	-moz-transition: max-height .4s;  	-o-transition: max-height .4s;  	transition: max-height .4s;  }  nav ul li:hover{  	background-color: #49ac6f;  }  nav ul li{  	display: inline-block;  	padding: 20px;  }  .handle{  	width: 100%;  	font-size: 24px;  	background: #a2a2a2;  	text-align: right;  	box-sizing: border-box;  	padding: 15px 10px;  	cursor: pointer;  	display: none;  }  @media screen , (max-width: 650px){  	nav ul{  		max-height: 0;  	}  	.showing{  		max-height: 21em;  	}  	nav ul li{  		box-sizing: border-box;  		width: 100%;  		padding: 15px;  		text-align: left;  	}  	.handle{  		display: block;  	}  }  .banner{  	width: 100%;  	margin: 0 auto;  	padding-top: 1000px;  	background-image: url('banner1.png');  }      </style>      <body>                	<header>          <h1>vector games</h1>          <img src="logo.png" alt="logo"/>      </header>        	<nav>      	<ul>          	<a href="#"><li>home</li></a>              <a href="#"><li>about</li></a>              <a href="#"><li>racing</li></a>              <a href="#"><li>arcade</li></a>              <a href="#"><li>strategy</li></a>              <a href="#"><li>puzzle</li></a>              <a href="#"><li>sport</li></a>          </ul>          <div class="handle">          &#9776;          </div>      </nav>      <div class="banner">                </div>      <script>          $('.handle').on('click', function(){              $('nav ul').toggleclass('showing');          });      </script>        <div class="banner">                </div>        </body>  </html>

oh , how able make image underneath nab bar responsive need scalable navbar. need setup media queries?

thanks, trace

try using:

background-repeat: no-repeat;

in header part of style.

w3schools.com


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -