To control overflow, you usually need to use the CSS overflow property
overflow: scroll
as indicated by pswg, but you will never need to apply it to the whole body as it suggests . The browser should add a scroll bar to the full page if your code is formatted correctly.
The current problem is most likely due to the fact that you are not closing the second <li> and incorrect PHP formatting. You do not need a break at the end of each line. The reason the lines are not broken is because you did not nest the <li> elements inside the <ol> or <ul> . Also, by starting your if statement, a filler, and ending inside separate php tags, just confuse the computer. Use instead:
<?php echo "<ul>"; for( $i=0; $i<500; $i++) { echo "<li>" . $i . "</li>"; } echo "</ul>"; ?>
source share