Dynamic page

I have an area that is filled with news for example

<div id="content"><?php 
/*       */ ?>

The question is as follows, please tell me where to find, read, explore where to move, let them do the following:
If there are a lot of news in the database, they begin to stretch the page at the bottom to infinity, you need to make it necessary to make a certain amount of news on the page, well, it would be possible to flip and choose the number of news output.

Answer 1, Authority 100%

Papagination – In principle
Papagination – on PHP, for example: here or here
CSS: Overflow