The Fairfax County Board of Supervisors last night enacted a law prohibiting discrimination against handicapped persons in hiring and employment, despite an opinion from the county attorney that the supervisors were exceeding their powers.

The measure, approved unanimously, was vigorously opposed by many local businessmen and the Chamber of Commerce, who argued that it will cost businesses hundreds of thousands of dollars to provide special accommodations, such as access ramps and persons skilled in sign language. Those accommodations were not specified in the law, but will be determined with the help of a special committee.

The measure exceeds present state and federal guidelines prohibiting discrimination against the handicapped.

At the last minute, County Attorney David T. Stitt reversed an earlier ruling by his office on the proposed law, contending it is too broad under the powers given to local governments by the state. His office approved the ordinance last year.

Board Chairman John F. Herrity said he expects the new county law to be challenged in court.

Other board members discounted the attorney's decision. "The pressing need for this law has been shown," said Supervisor James M. Scott. "Attorneys are fallible. We must choose on the basis of compassion rather than on the narrow grounds of legalism."

The board last night sidestepped setting specific guidelines for the special accommodations for handicapped persons required by the law as well as provisions governing compliance by private schools in their hiring and student admission practices. It established a special committee to develop these guidelines, with an Aug. 2 deadline for making recommendations.

Several supervisors have proposed setting monetary ceilings on the expenditures required for businesses to comply with the law. Those proposals are expected to be considered by the committee.