html - Offset a button Fixed amount of Pixels from a text input -


i have text input centered on page automatically have button next gets separated or overlaps depending how screen resized.. have this

<html>     <head>     <style>     .book2button{        text-align: center;       border: 1px solid #bdbdbd;       margin-left:70%;       margin-right: 30%;       position: fixed;      }      input[type="text"] {       margin-left:50%;       margin-right:50%;       border: 1px solid #bdbdbd;       position: absolute;      }     </style>      </head>       <body>         <div id = "a">           <input type = "text" name = "zip"    placeholder = "enter zip"/>            <a href = "book.html" class = "book2button"> submit</a>         </div>       </body> </html> 

and goal yahoo search bar button fixed amount of pixels away no matter how screen resized. have tried countless things such changing divs position, margins.. cant work using html , css. there away refer text input , create button margins there?

just center div content using text-align: center or center div using margin: 0 auto; add margin-left: 10px; button.

example: http://codepen.io/anon/pen/gpzwob


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -