html - How to align input text field in div by vertically? -


there following html code:

<div id="top">     <div id="search"><h2 id="title">tasks</h2><input type="text" id="key-words-search"/></div>     <div id="controls">         <?php echo chtml::link('button 1', array('add'), array('id'=>'add-vacancy', 'class'=>'button-style')) ?>         <?php echo chtml::link('button 2', array('add'), array('id'=>'add-vacancy', 'class'=>'button-style')) ?>     </div> </div> 

i'd align input text field in "search" div vertically. how can it? in advance.

the best , compatible way use margin-top.
example:

<html>     <head>         <style type="text/css">             input {                 height:50px;                 margin-top:25px;             }             div {                 height:100px;                 border:1px solid #f00;             }         </style>     </head>     <body>         <div>             <input type="text" />         </div>     </body> </html> 

ps: vertical-align:middle not work in internet explorer.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -