SAN FRANCISCO — It was not a happy day for the Happy Meal.

In what it described as a blow against the fattening temptations of fast food, the board of supervisors in Santa Clara County, south of San Francisco, voted Tuesday to ban the promotional toys that often accompany child-size portions of cheeseburgers and chicken nuggets if those meals don’t meet certain nutritional standards.

The criteria, which are based on federal standards and recommendations from the nonprofit Institute of Medicine, would apply to all fast-food restaurants giving away toys in meals in-tended for children. Ken Yeager, the board president, said the new law would level “the playing field by taking away the incentive to choose fatty, sugary foods over healthier options.”

“What we’re trying to do is de-link the connection between unhealthy food and toys,” said Mr. Yeager, who added that he believed children chose their meals based on the giveaway that came with it. “Why would a kid say ‘I want a burger with fries’? It’s the toys that they want.”

The law, the first of its kind, will allow restaurants to give away toys as long as the meals don’t contain excessive calories, sodium, sugar or fat. “This ordinance does not attack toys,” Mr. Yeager said just before the board passed the law by a 3-2 vote. “Toys, in and of themselves, do not make children obese.”