So I've been doing this for a few days and still am not getting the result I want.
I have some HTML coding something similar to this:
<div>
<div><img /><span></span></div>
<div><img /><span></span></div>
.
.
.
</div>
The problem I have is when the nested div exceeds the width of the browser, sometimes, the img tag stays on that same line but the cooresponding span tag next to it breaks off into a different line. How can I make sure that the entire nested div tag is broken off into the next line instead of breaking only certain child elements? By the way, the nested div tags have a CSS style display: inline-block; so they are placed side by side instead of different lines. I appreciate any help I can get. Thanks.
Problem: (pretend that the tags are the text itself in a web browser)
<div>
<div><img /><span></span></div><div><img /><span></span></div><div><img /><span></span></div><div><img />
<span></span></div>...
</div>
Solution: (take extra <div><img /> at the end of the second line in the problem code and move it to the third line)
<div>
<div><img /><span></span></div><div><img /><span></span></div><div><img /><span></span></div>
<div><img /><span></span></div>...
</div>