Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS css help with dynamic image size

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #42316
    KsChoice
    Member

    [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

    #122589
    Paulie_D
    Member

    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?

    #122595
    CarlRosell
    Participant

    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.

    #122598
    Paulie_D
    Member

    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.

    #122615
    KsChoice
    Member

    Paulie / Carl.
    Thx for the answers > I’ll check it out !

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.