How to cut off a page early

1330 views html
-5

So im hosting images on my page and the bottom of the images are uneven, so the bottom of the page is a uneven mess

https://i.imgur.com/zZ34QCV.png

Normally id try to just fit them together in a way thats a perfect square, but the page is supposed to be responsibe so its impossible to predict how big the page is.

Is there a way to cut off a web page after it reaches a certain %

answered question

What makes you think a responsive page can't be laid out well?

oh no it can, its just hard to know when to cut off the images to make them even when the page can change sizes

1 Answer

9

You basically want the content to be shown till only a certain length. The overflow property works best for these cases. I would suggest "wrapping" your entire content with a div. For example:

In your html

<div class="wrapper-cutter">
    <!-- Your images/content here -->
</div>

In your css

.wrapper-cutter {
    height: 300px; /*Pick it whatever you want*/
    overflow: hidden;
} 

Edit: Here I am assuming you know the length. From recent comments, there's a chance you don't. If you don't then this approach won't work. You will need js to find out the required length.

posted this

Have an answer?

JD

Please login first before posting an answer.

Ads

Categories