The mayor and council shall have the power and authority, by ordinance, to regulate the manner of the holding and conduct of all elections of said city, by providing rules and regulations relative to the time of opening and closing of polls, the location of voting precincts, the form of ballots when not otherwise provided, the marking of ballots, the conduct of persons at or near voting precincts, and such other rules and regulations governing said elections and the conduct thereof as may, in their discretion, be deemed necessary or proper, and which are not in conflict with the provisions of this Act [article] or contrary to law.