Here is the HTML code I'm working with:
.parent{
border: 1px solid;
width: 70%;
}
.title{
width: 50px;
}
.input {
}
<div class="parent">
<span class="title">title: </span>
<input class="input" name="title" type="text">
</div>
I am facing an issue where I need to adjust the width of the .input
element to be width: 100%;
. However, doing so results in both the .title
and .input
elements not being on the same line anymore. How can I make sure they remain on the same line while filling the entire width of their parent container (.parent
)?
Note: I have explored some solutions using either flex
or calc()
, but most of my website's users are using older browsers. Therefore, I am looking for a solution that supports older browsers as well.