html - Creating a Responsive input field between other elements -
having trouble getting search input act responsively in header.
in codepen have basic header, logo left, search bar in middle , navigation buttons on right. goal search / input bar in middle responsive , stretch fill space between logo , navigation buttons left/right margin.
in attempts haven't been able replicate basic reponsiveness of input @ bottom set 100%.
*how approach problem?*
http://codepen.io/leongaban/pen/wipav
my input:
<div class="navigation"> <div class="head-search"> input should responsive <input class="txtinput" type="text"/> <img src="http://leongaban.com/_stack/images/search_button.png" alt="search"/> </div> <nav id="user-actions"> <ul> <li class="btn-blue user-action" data-btn="login" data-pane="login">log in</li> <li class="btn-purple user-action" data-btn="signup" data-pane="signup">sign up</li> </ul> </nav>
.navigation { width: auto; float:right; margin:0px; list-style:none; background:#ccc; margin-bottom:20px; } .head-search { width: auto; float: left; } .head-search input { float: left; width: 100%; /* max-width: 290px; */ height: 25px; padding: 0 5px; margin: 10px 5px 10px 0; }
any , tips appreciated!
if logo on left , navigation on right size have fixed can achieve responsive search bar following code:
e.g. logo width 150px , navigation width 400px
.navigation { width: 100%; margin:0px 0 20px ; list-style:none; background:#ccc; width:100%; } .logo{ float:left; width:150px; } .head-search { position:relative; margin: 0 400px 0 150px; } .head-search input { float: left; width: 100%; /* max-width: 290px; */ height: 25px; padding: 0 5px; margin: 10px 5px 10px 0; } #user-actions{ width:400px; float:right; }
Comments
Post a Comment