Michael Chopra put his goal drought behind him to push Cardiff back into the play-off places with a hat-trick.
Michael Chopra claimed a fine hat-trick against Leicester
The 23-year-old opened his account by floating a free-kick over Leicester's wall into the top corner of the net.
Joe Ledley's slide-rule pass picked out Chopra for his second, then strike partner Steve Thompson squared the ball for Chopra to roll home an easy third.
Patrick Kisnorbo headed in a corner to give Leicester hope, but a second Foxes goal from Elvis Hammond came too late.
The win was the perfect way for Cardiff boss Dave Jones to celebrate his 500th senior professional game as a manager.
Cardiff manager Dave Jones:
"We make life difficult for ourselves, maybe it's the youth of the back four, but sometimes we tie ourselves in knots.
"But the three goals that Chops (Michael Chopra) has scored are fantastic and that eases a little bit of the nerves.
"But you learn how to be winners, some of them have not been at this stage at a football club ever."
Leicester manager Rob Kelly:
"When you come to somewhere like Cardiff and score two goals you expect to get something out of the game - but we shot ourselves in the foot.
"I know all three of Cardiff's goals were good finishes but we should have done better with them.
"We know we must do better. We have got good players but we are inconsistent and we have to find out why."
Cardiff: Alexander, Gilbert, Loovens, Johnson, Ledley, Whittingham (Flood 75), McPhail, Parry, Scimeca (McNaughton 35), Chopra, Thompson (Byrne 90).
Subs Not Used: Forde, Campbell.
Goals: Chopra 21, 57, 69.
Leicester: Henderson, Maybury, Kisnorbo, McCarthy, McAuley, Hughes, Williams, Wesolowski (Johnson 46), Porter (Cadamarteri 79), Hume, Fryatt (Hammond 44).
Subs Not Used: Logan, Stearman.
Booked: Kisnorbo, Hume.
Goals: Kisnorbo 71, Hammond 89.
Ref: K Stroud (Hampshire).