I have an html tag with a label and an input box. However, for business reasons, I need to show the shortcut and input field on Sameline and hide the placeholder text. The end result should look like the placeholder text is stored there. Example here: http://jsfiddle.net/XhwJU/
Here is the link for the link:
<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Test Page</title> </head> <body> <h1> test </h1> <div class="inputdata"> <label for="AccessCode"> Access Code: </label> <div style="display:inline"> <input type="text" name="accessCode" id="AccessCode" value="" placeholder="" /> </div> <div class="clear"></div> </div> </body> </html>
Here are the styles used:
.inputdata { border: thin solid gray; padding: 0.1em; margin: 0.1em; vertical-align: middle; } div .inputdata label { width:auto; float:left; color: gray; line-height: 2; padding-top: .4em; } input[type='text']{ overflow:hidden; line-height: 2; box-shadow: none; border:none; vertical-align: middle; background:none; width:100%; } .clear { clear: both; height: 1px; overflow: hidden; font-size:0pt; margin-top: -1px; }
As you can see in jsfiddle, the shortcut and input are displayed on separate lines. I want the label and input to appear on the same line regardless of the width of the screen. The label must have a fixed size, which allows it to place the content on one line, and the input should occupy the rest of the screen width.
appreciate any help
Kiran
source share