I have added the 2D box collider to the floor, 2D box collider and 2D rigid body to the player. But the player still fall through the floor.

The problem is recorded here: https://www.loom.com/share/75a374169a2c446186c5044f7c65dd36

The floor collider should not be of type isTrigger, uncheck that.