- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
[Your text to link here…](http://www.hartstikkide.be/temp/css.jpg “image”)
(see linked image)
I have problems with my (css-)layout.
I have an outer box > no fixed width > has to follow te inner image-width
I have 2 inner boxes > the first contains the image
The second contains some text > the width of this box > must be the same width as the image
Any advise / tips ???
THX
Koen
Unless your images are of a consistent width you are going to end up with a series of stacked boxes with random widths.
Would it not be better to set a width for the container and have the images adapt to that?
you could do something like [This…](http://codepen.io/anon/pen/zdDLE “This…”)
that example will set the width of the outer box by checking the .image class inside of it.
That works quite nicely (with a little tweaking): http://codepen.io/anon/pen/ywbGH
I have zero JS skills so I’m sure it could be improved and the structure/CSS simplified.
Paulie / Carl.
Thx for the answers > I’ll check it out !