Css trick to conjoin divs.
- by Jronny
Is there a way we could conjoin three divs together?
Hello
<div class="mainContainer">
<div class="LeftDiv"></div>
<div class="CenterDiv">
<input id="txtTest" type="text"/>
</div>
<div class="RightDiv"></div>
</div>
World!
what we need here is to present the code this way:
Hello<*LeftDiv*><*CenterDiv with the textbox*><*RightDiv*>World
I tried to use float:left on LeftDiv, CenterDiv and RightDiv but the css also affects the mainContainer. I also need to set the LeftDiv's and RightDiv's height and width on the css but I just can't do it without the float.
Thanks in advance.
Edit: Added question - when LeftDiv, CenterDiv and RightDiv are floated-left, why is mainContainer affected? i just want to have the three inner divs conjoined without affecting the parent div's behavior...