"mobile"
Bootstrap 3.0.0 Snippet by evarevirus

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html><html class=''> <head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/Ally__Baird/pen/wMGZyx?limit=all&page=35&q=mobile" /> <style class="cp-pen-styles">@import url(https://fonts.googleapis.com/css?family=Roboto+Slab:400,300|Varela+Round); body { background-color: #e2e2e2; color: #222; font-family: 'Roboto Slab', sans-serif; font-size: 1em; /* 16px */ line-height: 1.5; margin: 0; } svg { display: block; } /* objects -------------------------------- */ .wrapper { margin: 80px auto; width: 80%; } .container { background-color: #fff; height: 600px; margin: 0 auto; width: 320px; } header { background-color: #222; overflow: hidden; margin: 0 auto; padding: 15px 10px;; width: 300px; } /* search + logo + burgerbox -------------------------------- */ h1.logo, .burgerbox, .search, .searchclose { height: 30px; cursor: pointer; width: 30px; } h1.logo { color: #fff; float: left; font-size: 19px; font-weight: 400; letter-spacing: 0.04em; line-height: 1.5; margin: 0 35px; text-align: center; width: 160px; } .burgerbox { float: right; } .search { float: left; } svg:hover path.search { fill: #ccc; } input { cursor: pointer; } input[type="text"] { background-color: #eaeaea; border: none; float: left; height: 20px; padding: 10px 0 10px 10px; width: 250px; } input:focus { border: none; outline: none; } input[type="button"] { background-color: #222; background-image: url(assets/img/searcharrow.svg); background-repeat: no-repeat; background-position: center center; border: none; color: #fff; float: right; height: 40px; width: 40px; } input[type="button"]:hover { background-color: #666; } /* svg hover effects -------------------------------- */ svg:hover line.grey { stroke: #ccc; } svg:hover polyline.grey { stroke: #ccc; } .searchclose { float: left; } /* hamburger navigation -------------------------------- */ .hamburger .close { position: absolute; z-index: 100; } .menu { background-color: #eaeaea; height: 540px; position: fixed; width: 320px; } .menu ul { padding: 0; } .menu li { border-bottom: 1px solid #ccc; font-size: 0.88em; list-style-type: none; padding: 10px; } .menu li.option:hover, .contact__one:hover, .contact__two:hover { background-color: #222; color: #fff; } .dropdown li:hover { background-color: none; } li.contact { border: 0; padding: 0; } .contact__one, .contact__two { background-color: #999; cursor: pointer; display: block; padding: 10px 0; text-align: center; width: 150px; } /* links -------------------------------- */ a:link { text-decoration: none; } a:visited { color: #222; text-decoration: none; } a.cta { background-color: rgba(34,34,34,0.4); border: 1px solid #fff; border-radius: 10px; color: #fff; display: inline-block; font-size: 16px; line-height: 1; letter-spacing: 0.1em; margin-top: 130px; padding: 9px 32px 10px 32px; } a.cta:hover { background-color: rgba(34,34,34,0.7); padding-right: 40px; padding-left: 40px; } /* search box -------------------------------- */ .searchbox { background-color: #fff; height: 40px; padding: 10px; width: 300px; } /* hero -------------------------------- */ .hero { background-color: #666; background-image: url('http://allybaird.com/codePen/img/ny-hero.jpg'); background-repeat: no-repeat; height: 180px; padding: 30px 10px; text-align: center; width: 300px; } /* main -------------------------------- */ .main { margin: 30px auto; width: 300px; } .main a { color: inherit; text-decoration: underline; } .main a:hover { color: #999; text-decoration: none; } .border-bottom { border-bottom: none !important; }</style></head><body> <div class="wrapper"> <div class="container"> <!-- search bar section --> <form class="searchbox" name="search"> <input type="text" placeholder="What are you looking for?" required> <input type="button" value="Go"> </form> <header role="banner"> <div class="search"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <path class="search" fill="#ffffff" d="M19.787,12.749c0-4.209-3.412-7.584-7.584-7.584c-4.21,0-7.584,3.411-7.584,7.584 c0,4.209,3.411,7.585,7.584,7.585C16.375,20.37,19.787,16.958,19.787,12.749z M25.412,25.342l-0.653,0.653L17.864,19.1 c-1.524,1.344-3.484,2.177-5.698,2.177c-4.717,0-8.527-3.81-8.527-8.527c0-4.717,3.811-8.527,8.527-8.527 c4.719,0,8.527,3.811,8.527,8.527c0,2.178-0.833,4.174-2.177,5.698L25.412,25.342z"/> </svg> </div><!-- /.search --> <div class="searchclose"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <line <line class="grey" fill="none" stroke="#ffffff" stroke-width="1" stroke-miterlimit="10" x1="7.167" y1="7.25" x2="22.209" y2="22.291"/> <line <line class="grey" fill="none" stroke="#ffffff" stroke-width="1" stroke-miterlimit="10" x1="22.209" y1="7.25" x2="7.167" y2="22.291"/> </svg> </div> <h1 class="logo"> Logo </h1> <nav role="navigation" class="burgerbox"> <div class="hamburger"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <polyline class="grey" fill="#ffffff" points="2.875,6.302 26.938,6.302 26.938,5.5 2.875,5.5 "/> <polyline class="grey" fill="#ffffff" points="2.875,15.276 26.938,15.276 26.938,14.474 2.875,14.474 "/> <polyline class="grey" fill="#ffffff" points="2.875,24.25 26.938,24.25 26.938,23.447 2.875,23.447 "/> </svg> </div> <div class="close"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="30px" height="30px" viewBox="0 0 30 30" enable-background="new 0 0 30 30" xml:space="preserve"> <line class="grey" fill="none" stroke="#ffffff" stroke-width="1" stroke-miterlimit="10" x1="7.167" y1="7.25" x2="22.209" y2="22.291"/> <line class="grey" fill="none" stroke="#ffffff" stroke-width="1" stroke-miterlimit="10" x1="22.209" y1="7.25" x2="7.167" y2="22.291"/> </svg> </div> </nav> </header> <!-- hamburger dropdown section --> <nav role="navigation" class="menu"> <ul> <a href="" title=""><li class="option">Option One</li></a> <a href="" title=""><li class="option">Option Two</li></a> <a href="" title=""><li class="option">Option Three</li></a> <a href="" title=""><li class="option">Option Four</li></a> <a href="" title=""><li class="option border-bottom" style="margin-bottom: 40px;">Option Five</li></a> <li class="contact" style="overflow: hidden;"> <a href="" title=""><div class="contact__one" style="float: left;"> Contact 1 </div></a> <div class="contact__two" style="float: right;"> Contact 2 </div> </li></a> </ul> </nav> <section class="hero"> <a class="cta" href="">Action</a> </section> <article class="main" role="main"> Quickly put this together as an idea for a mobile nav and search combo, view the code <a href="https://codepen.io/AllyBaird/full/wMGZyx/" target="_blank">here</a>. </article> </div><!-- /.container --> </div><!-- /.wrapper --> <script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script><script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js'></script> <script > $( document ).ready(function() { // search box $( ".searchclose" ).hide(); $( ".searchbox" ).hide(); $( ".search" ).click(function() { $( ".searchbox" ).slideToggle( "slow", function() { $( ".search" ).hide(); $( ".searchclose" ).show(); }); }); $( ".searchclose" ).click(function() { $( ".searchbox" ).slideToggle( "slow", function() { $( ".searchclose" ).hide(); $( ".search" ).show(); }); }); // open hamburger $( ".close" ).hide(); $( ".menu" ).hide(); $( ".hamburger" ).click(function() { $( ".menu" ).slideToggle( "slow", function() { $( ".hamburger" ).hide(); $( ".close" ).show(); }); }); // closing - when list item is clicked $( ".option" ).click(function() { $( ".menu" ).slideToggle( "slow", function() { $( ".close" ).hide(); $( ".hamburger" ).show(); }); }); // close hamburger $( ".close" ).click(function() { $( ".menu" ).slideToggle( "slow", function() { $( ".close" ).hide(); $( ".hamburger" ).show(); }); }); // back to top scroll $('.top').click(function(){ $('html, body').animate({scrollTop : 0},"slow"); }); }); //# sourceURL=pen.js </script> </body></html>

Related: See More


Questions / Comments: