Here's a solution using mouseover
to show a text input, which is hidden again once the user changes the input's value. Some of the CSS I used is a bit hacky to make the example prettier, but bits that matter for functionality are:
#container has position: relative;
(This lets children be absolutely positioned inside)
#myImg has float: left;
(and its width property is defined and not too wide)
#textContainer has position: absolute; display: none;
(and its left
property equals the width of #myImg
)
#more-content-to-right has float: left
(and its width property is defined and not too wide)
#more-content-below has clear: both
In production, I'd get rid of the borders and use more robust techniques for "prettification".
function showTextContainer(){
document.getElementById("textContainer").style.display = "block";
}
function hideTextContainer(){
document.getElementById("textContainer").style.display = "none";
}
#container { position: relative; width: 530px; margin: 0 0; padding: 2px; }
#myImg { height: 100px; width: 200px; float: left; }
#textContainer { position: absolute; left: 200px; top: 50px; height: 1.3em; width: 200px; display: none; }
#textbox {width: 98%; }
#more-content-to-right { float: left; height: 100px; width: 300px; }
#more-content-below { clear: both; height: 100px; width: 508px; }
.bordered { border: 1px solid gray; margin: 3px;}
<div id="container" class="bordered">container<br/>
<div id="myImg" class="bordered" onmouseover="showTextContainer()">img</div>
<div id="textContainer" class="bordered">
<input id="textbox" placeholder="type stuff here" onchange="hideTextContainer()" />
</div>
<div id="more-content-to-right" class="bordered">more content to right</div>
<div id="more-content-below" class="bordered">more content below</div>
</div>