Initially, I must mention that this question may appear similar to mine, but it is actually different.
My HTML code is as follows:
.parent{
border: 1px solid gray;
width: 70%;
}
.title{
border: 1px solid green;
}
.input {
/* width: fill_parent; */
}
<div class="parent">
<span class="title">title: </span>
<input class="input" name="title" type="text" placeholder="Choose a precise title">
</div>
My objective is to assign a value akin to fill_parent
to the input's width
. The width of the parent container (.parent
) is defined by a percentage, adjusting according to screen size changes. Therefore, using a fixed px
value for the .input
width is not feasible.
Please note: Simply applying .input{width: 100%;}
is not suitable since I want both the title and input elements to stay on the same line.
Any recommendations?