Here is one approach using a wrapper around the input element.
Suppose that you have the following HTML:
<div class="input-wrap">
<input type="text" value="Search...">
</div>
Apply the following CSS:
.input-wrap {
display: inline-block;
position: relative;
border-bottom: 1px solid red;
border-left: 1px solid red;
height: 10px;
width: 100px;
}
.input-wrap input {
position: absolute;
bottom: 0;
left: 0;
width: inherit;
border: none;
background-color: beige;
}
Fiddle: http://jsfiddle.net/audetwebdesign/rLCHa/
In this construction, the outer .input-wrap
element controls the width of the input field and the bottom border, and the height of the left border (10px in this example).
The input field is positioned absolutely and pinned to the bottom of the parent container, and inherits the width. The input field's height is the default value, but you can control it independently from the height set in the .input-wrap
element.