Search code examples
htmlimagecsshref

How to force/wrap <img> inside div?


I have a Wrapper that contains a bunch of thumbnails for a photo gallery with fancybox.

<div class="wrapper">
    <a href><img thumbnail></a>
    <a href><img thumbnail></a>
    <a href><img thumbnail></a>
    ...
</div>

The wrapper has a defined width. The number of thumbnails varies from 1 to ... The problem is that the space inside the wrapper is only for a maximum count of 7 thumbnails. So all thumbnails over 7 will be displayed outside. How can I archive that all thumbnails will remain inside the wrapper `' so that all over 7 are kind of hidden?

Thanks a lot.


Solution

  • add this css to your .wrapper div

    .wrapper {
        overflow:hidden;
    }