The county board may declare that the violation of any ordinance shall be a penal offense and prescribe penalties for a violation. The penalties shall not exceed those permitted for conviction of a misdemeanor as defined by law.