The Cottagers' success came while Luton Town climbed off the bottom of the table by beating fellow struggler Huddersfield Town.
Aleksandar Mitrovic marked his return to Fulham's team from a three-game suspension with his 24th league goal this season, guiding a 35th-minute penalty into the top-right corner after he was fouled by Cardiff's Dion Sanderson.
Josh Onomah doubled Fulham's advantage in the 66th minute with a quick touch and shot that was arrowed across Alex Smithies.
Scott Parker's side saw out a win that moved it up to third and closed the gap to West Bromwich Albion in the second automatic promotion berth to four points, while sixth-placed Cardiff could slip to ninth if results elsewhere go against it this weekend.
A pair of second-half goals saw Luton claim an important 2-0 victory over Huddersfield at John Smith's Stadium.
Sonny Bradley nodded home James Bree's corner within four minutes of the restart, before Elliot Lee fired beyond Jonas Lossl after James Collins' attempt came back off the post.
Luton consequently moved above Barnsley and two points adrift of the last currently safe teams, with Huddersfield just two points clear of the bottom three in 19th.