<div id="d1">
<div id="d2">label</div>
<div id="d3"><input name="t1" id="t1" type="text" /></div>
<div id="d4">Message</div>
</div>
#d1
and#d2
has fixed width.#d4
can be displayed or hidden (visibility: visible;
orvisibility: hidden;
). When it's visible, it has fixed width.
I want that #d3
have a variable width, so it can fill the remaining right space of #d1
when #d4
is hidden, but when #d4
is visible, fill the space between #d2
and #d4
.
How can achieve this using CSS?