I have a div containing a paragraph and an image floating right from it.
The image is variable in size and relative to the viewport, so I can’t use a fixed height for both the paragraph next to it and to image ("simulating" a floating picture).
Here is an example pen of the setup: https://codepen.io/etlaM/pen/vYvzEoQ
The styling of the image is as simple as follows:
.textimage {
width: 50%;
float: right;
}
My customer would like to have the text split into two columns after the height of the floating image.
So basically a look like in a newspaper.
I don’t think this is possible with pure CSS. But I wanted to ask you first before getting heights with JS.
Is there any way to style the elements (maybe structure them differently) to achieve the wanted look?
Thanks!
2
Answers
You could use a table / columns or use a framework like bootstrap to do following:
Newspaper structure with columns exist : CSS multi-column layout
Use css property
column-count : ...
Sanple code: