Is there a simple way to let the input
grow from left to right like the div in my example do? Why does the input tag (and also button) not work like a div in this case (is the missing </input>
the problem for tags like this)?
Example HTML:
<div class="wrapper">
<div></div>
<input>
</div>
Example CSS:
.wrapper {
position: relative;
width: 300px;
height: 300px;
background-color: blue;
}
div {
position: absolute;
top: 0;
left: 20px; /* <-- working */
right: 20px; /* <-- working */
height: 20px;
background-color: red;
}
input {
position: absolute;
top: 20px;
left: 20px; /* <-- isn't working */
right: 20px; /* <-- isn't working */
height: 20px;
background-color: orange;
border: 0;
}
Example Fiddle