A variant occurs in one manga of Read or Die, where the floor is in fact a lot of paper being held rigid by Yomiko's will. The building was under construction at the time.
NEEDLESS inverts this with a character who can turn things invisible - large projectiles, most of the floor except the small patch on which the heroes are standing, the wall between him and them...the trick is to keep them from realizing what he's doing.
This is part of Mysterio's M.O. in Spider-Man comics and cartoons.
Peters of Event Horizon was killed in this fashion when the evil ship created an illusion in her mind of a bridge across an open shaft with her son on the other side, resulting in her falling to her death on the gravity chamber floor.
Lasciel in the Dresden Files book Dead Beat pulls this on Harry, filling an apartment with illusionary flame and putting an illusionary fire escape outside the window before breaking the illusion to show that it could easily kill Harry, but doesn't want to.
In two Discworld books (The Colour of Magic and Moving Pictures) the Tower of Art at the University is the scene for this trope. In both cases, the hero has to ascend a spiral staircase inside a crumbling 800foot tower, trusting to their senses that the stairs are still there under their feet - this is not a given. The trick is to close your eyes and really believe the stairs are still intact and can carry your weight - even when they are not.
In Going Postal, Moist has a ghostly vision of the post office at its height and splendor. During this vision, he's walking around, and he realizes that the floor ahead of him in the vision is where the hallway he's in, in the present, abruptly ends with a long drop. One of the previous postmasters had been found, dead of a fall, right under where the hallway is, so Moist realizes this is what had happened.
In Point Blank, the second book in Anthony Horowitz' Alex Rider series, a murder is set up by putting a holographic elevator into an out-of-order elevator shaft.
In Xanth, Iris has the power of illusions, and this is one of the things she can do.
While Calesta, the Big Bad of the Coldfire Trilogy is incapable of hurting people directly, his illusion powers make it easy for people to not notice a real danger, or a way to avoid said danger. At one point he makes an entire city fail to notice an incoming tidal wave.
A version of this is used to perform a nearly perfect murder in the Father Brown series. The murderer simply informs his (blind) lover that he is holding the elevator for her, then heads up a floor (the elevators are essentially silent), heads out onto his balcony where several hundred people can testify to his location, and waits for the lover to run into the now-empty elevator shaft.
Live Action TV
House uses this a lot, in the "patient of the week is hallucinating" form.
Royal Pains does a similar version, where a "haunted" client can't tell the difference between a floor three inches below or thirty feet below.
One case in the original CSI: Crime Scene Investigation involved a woman who'd jumped off a high-rise apartment balcony in her bikini. She'd been hypnotized to think she was taking a dip at the beach.
Probe, a short-lived scifi-detective series from the Eighties, had a plot where a murderer lured people into an open elevator shaft to their deaths, by using holograms to make it seem like the elevator car had arrived.
Inverted in Stargate SG-1 when the heroes have to cross a narrow bridge over a deep chasm. One of them falls...and lands unharmed on top of the illusory hole.
Dungeons & Dragons 3rd Edition suggested in the Dungeon Master's guide that an effective trap would be an illusionary floor over a pit of acid.
Old gamers of the Castlevania series may remember Simon's Quest and its annoying fake floors, which can only be detected if you fell through them or if you made obssessive use of Holy Water to figure out which floors aren't fake.
The Mega Man games occasionally use this trick. Two examples that stand out are Mega Man 2, where they can be detected by a weapon that follows the ground, the Bubble Lead, and 9, where there are actual enemies that fly by to create holographic platforms over pits right by the real ones.
In Spiderman The Animated Series, Spider-Man inverted this with one of Mysterio's holocubes by projecting a gaping chasm below Rhyno, making him panic and flail around.
While he occasionally does the opposite, Wile E. Coyote is known for his painting of a bridge in front of a chasm. The road runner takes the bridge, Coyote tries to chase it, rips through the picture and falls.
In Batman Beyond, Spellbinder uses an illusion to nearly trick Terry into walking off a cliff. He has also tricked Terry into diving off of a building by projecting a waterfall over it.
The famous Blackpool Tower, in the English seaside resort, stands nearly 500 feet tall. In its upper reaches, it has a perfectly walkable floor with secure side walls. Only it's all made out of perspex. You are faced with a test of your nerve and susceptibility to vertigo, in walking across what at first glance appears to be empty space with a very long drop to the promenade below. A whole gallery of images here.
A psychological experiment performed on very young kittens was to separate them from their mother and place them in a box where the only way out was a completely clear perspex tunnel suspended about four feet above ground level. Their mother was placed at the other end where the kittens could see, hear, and smell her. This tested both the kittens' and the mother's senses. The kittens were faced with discovering they could safely negotiate a passage that was apparently not there. Would they be able to perceive it and overcome their fear, given the incentive of getting back to Mother. And of course the mother cat, with greater experience, was equally free to discover for herself she could walk the same passage to get her kittens back.
A similar experiment was conducted with human babies, done with a long ledge where the center was a clear plastic "bridge" over a gap, with their mothers on the other side.