Cardiff managed just 28% possession against Queens Park Rangers but despite long periods of watching the visitors pass it around and about, City were lethal when they did get the ball and pushed forward.
Rangers hit the post twice and saw former keeper Alex Smithies make two good saves against them but that was it as far as efforts anywhere near the goal.
Cardiff scored from two set pieces and a counter attack as they took three points and moved to seven games unbeaten.
The opening goal came after 11 minutes. Lee Tomlin's back post free kick was met but Aden Flint who's downward header into the ground bounced up for Sean Morrison to head in for 1 - 0.
The second goal in first half injury time came from a training ground corner move. Tomlin caught the defence out with a neat ball to Gavin Whyte and his cross met a totally unmarked Marlon Pack two yards from goal for a tap in.
City were happy to defend their lead and let Rangers wear themselves out getting nowhere. On 72 mins City got the chance to break and Pack found Leandro Bacuna on the right and his cross was met by sub Callum Paterson who saw his effort from 17 yards ricochet off the ground and into the top corner.
Pack went close with a header that would have made it four but a clean sheet, a home win and now unbeaten in seven sees City two points off the top six
Cardiff City: Smithies; Peltier, Flint, Morrison, Bennett; Bacuna, Pack; Whyte (Hoilett 87'), Tomlin (Paterson 65'), Murphy; Glatzel (Ward 82')
Subs: Etheridge, Coxe, Nelson, Mendez-Laing
QPR: Kelly; Rangel (Kane 68'), Cameron, Leistner, Manning; Ball (Wells 63'), Chair (Pugh 80'), Scowen, Eze; Osayi-Samuel, Hugill
Subs: Lumley, Wallace, Mlakar, Masterson
Referee: Matt Donohue