GLENDALE, Ariz. – The Cardinals arrived with the league’s 31st-ranked offense, the 49ers had the NFL’s top-ranked defense, and the results were predictable.

In a 24-3 romp over Arizona, San Francisco allowed 7 rushing yards, tying a team record set in 1972, collected four sacks and didn’t allow an opponent to score a touchdown for the fourth time in five games.

At halftime, the Cardinals had as many punts (four) as first downs, and quarterback John Skelton had a 33.2 rating.

There were several standouts: Linebacker Aldon Smith had two sacks, cornerback Chris Culliver defended five passes and had an interception, and safety Dashon Goldson placed a bone-jarring, second-half hit on wide receiver Early Doucet that head coach Jim Harbaugh said “Vince Lombardi would be proud of.”

Still, safety Donte Whitner highlighted another star, Vic Fangio.

“I honestly believe we have the best defensive coordinator in the National Football League,” Whitner said. “He’s a very smart guy, very prepared, and that’s why we played the way we played.”

Against an offensive line that had allowed a league-high 35 sacks, San Francisco eschewed blitzing and dropped defenders into coverage. The plan helped limit All-Pro wideout Larry Fitzgerald (five catches, 55 yards) to one reception for 13 yards in the first three quarters.

“We are for real,” cornerback Carlos Rogers said. “We have a pretty good defense. We can’t deny that.”

Gore’s ribs OK: Running back Frank Gore had 55 yards on 16 carries while playing with bruised ribs. Gore said the injury was particularly painful when he made certain moves. Gore expects to be back to full strength following the upcoming bye week.

“I felt good – there were certain movements” that hurt, he said. “But I decided to play and I didn’t think about it.”

Staley had pneumonia: Left tackle Joe Staley, questionable for Monday’s game because of an illness, said he had a case of bacterial pneumonia that caused him to lose about 10 pounds. Staley, who started, had a 104-degree temperature early in the week before practicing Friday and Saturday.

Briefly: Running back Brandon Jacobs was a healthy inactive. Jacobs made his debut with the 49ers in Week 7, but did not play. … Every member of the 49ers’ draft class on the 53-man roster was inactive: wide receiver A.J. Jenkins, running back LaMichael James, guard Joe Looney and safety Trenton Robinson. … Cardinals guard Adam Snyder, who played for the 49ers from 2005 through ’11, was inactive because of a quadriceps injury. Rich Ohrnberger, 26, made his first career start in place of Snyder.