
46 Wis.2d 172 (1970)
174 N.W.2d 528
POSNANSKI, Respondent,
v.
HOOD, Appellant.
No. 79.
Supreme Court of Wisconsin.
Argued February 5, 1970.
Decided March 3, 1970.
*174 For the appellant there was a brief and oral argument by Louis J. Mestre of Milwaukee.
For the respondent there was a brief by Usow, Teper & Weiss, attorneys, and Beverly A. Monson of counsel, and oral argument by Richard A. Victor, all of Milwaukee.
A brief amicus curiae was filed by James Walrath of Milwaukee for the Milwaukee Tenants Union.
CONNOR T. HANSEN, J.
The defendant occupied the premises of the plaintiff on a month-to-month oral lease and vacated them after becoming arrear in several months' rent payments. When the plaintiff commenced action to collect the arrearage, the defendant pled the following affirmative defense in his answer:
"5. That the lease sued upon by the plaintiff is illegal and contrary to public policy and is therefore void and unenforceable."
This affirmative defense is predicated upon the defendant's assertion that there were certain defective conditions *175 in the housing accommodations which violated the Milwaukee Housing Code, which in turn obviated any obligation of the defendant to pay rent while these violations existed. Evidence premised on this defense was rejected by the trial court.
The issue on this appeal is whether the trial court committed error in not allowing defendant to establish, as an affirmative defense, violations of the Milwaukee Housing Code, which defendant argues rendered the oral lease agreement between the parties null and void.
At the trial, the defendant testified he vacated the premises because plaintiff did not repair the kitchen and bathroom ceilings where plaster had fallen down, an oil leak in the furnace which rendered it inoperable, and the locks on the doors. Defendant also complained to plaintiff about a broken window in the bathroom; however, this was repaired before defendant vacated. Defendant had inspected the premises before renting, and testified that the residence was in good condition at that time, except for the locks on the doors.
During the trial, defendant offered the testimony of an inspector for the Milwaukee health department. He testified he had inspected the premises, but further questioning of him was objected to on the grounds that such evidence was immaterial. Counsel for defendant stated the witness would testify there were conditions existing during the period involved which would have constituted violations of the Milwaukee Housing Code. Counsel also recited defendant's contention as to the impact of the health ordinances:
".... They [housing ordinances] describe a certain set of circumstances, and if those circumstances can be shown to exist, whether or not the Health Department has found that they do exist or not, is immaterial. If I can show to the satisfaction of the court that certain conditions occur, were present, during this time and at these premises, which would, if found, seen by an inspector of the Health Department on a survey, constitute a violation, then this defense is good. I don't feel that there is any *176 need or requirement that there be a finding of a violation by the Health Department prior to this, or a conviction in a court of a violation."
Judge WICKLUND ruled such evidence was admissible to establish a defense under sec. 234.17, Stats.,[1] but the same evidence was for a "collateral purpose" and inadmissible if the objective was to show that the residence "was untenantable under a certain ordinance of the city of Milwaukee..." Defendant thereupon elected not to proceed with offering evidence of the alleged code violations. Thus, while evidence in support of defendant's affirmative defense could have been introduced under sec. 234.17, this statute was not in defendant's pleadings, nor is there any indication defendant ever intended to rely upon it. As a result of this situation there is no evidence in the record of any housing code violations, or that any orders were issued by the commissioner of health with respect to the residence rented to defendant.
On appeal to the circuit court, it was held there was no evidence in the record as to any violation of health department regulations, but the circuit court assumed, arguendo, that the inspector was going to testify that some orders had been issued by the health department to make certain repairs or alterations in the premises. However, the issue of whether the lease agreement was illegal and contrary to public policy was not reached. The circuit judge reasoned that since the trial judge had expressed a willingness to receive evidence under sec. 234.17, *177 Stats., there was no prohibition on getting the desired evidence into the record and therefore defendant was foreclosed from raising any issue with respect to such proffered evidence. In essence, the circuit court held a litigant must put in essential evidence under any means possible. Thus, the initial question presented on this appeal is whether the defendant presented the affirmative defense to the lower courts in a manner sufficient to now have this court review the validity of that defense.
"Where a matter is properly raised in the trial court by the pleadings, evidence, motions, or appropriate requests for rulings, it is sufficiently presented for review on appeal. Within this rule, `properly raised' means that the question must have been timely called to the attention of the lower court, and this rule has been applied to pleas of estoppel or ratification, laches, waiver, proof of loss under an insurance policy, and to affirmative defenses. For example, affirmative matter of defense is not timely raised if made for the first time on motion for new trial, or by objection to entry of judgment.
"It is often difficult to determine when a matter has been sufficiently presented before the trial court in order that it may be reviewed on appeal. At the very least, the matter must have definitely been called to the attention of the trial court sufficiently to obtain a ruling thereon.... As this rule is ordinarily a rule of practice, it need not be rigidly followed, and a mere failure to make the exact motion to technically raise the issue or point should not prevent a review thereof...." 4 C. J. S., Appeal & Error, pp. 751-755, sec. 243.
In this particular case the defendant was not concerned with the defense provided under sec. 234.17, Stats., but was intent on proving a contract illegal by way of a housing code violation. The defense was pled; a witness called; offer of proof was made; the question was raised on appeal to the circuit court and on rehearing to that court. We conclude these efforts were sufficient to bring the affirmative defense issue before the county and circuit *178 courts and preserve the question for appeal to this court.
The defendant's argument in support of his affirmative defense is primarily based on sections 75-5 through 75-8 of the housing ordinances of the city of Milwaukee.[2] Each of these sections begins with language to the effect that no person shall occupy as owner-occupant or let to another for occupancy any dwelling or dwelling unit for living purposes which does not comply with the requirements listed therein. Defendant contends these are mandatory prohibitions to be strictly enforced and that any lease agreement of premises which does not comply with these ordinances is illegal, contrary to public policy and, therefore, void and unenforceable.
The public policy of this state and the city of Milwaukee with respect to blighted and substandard housing is clear:
"There can be no doubt that the legislature and the common council of the city of Milwaukee have both recognized that blighted, substandard and insanitary housing conditions do exist and that they are detrimental to the public interest." Dickhut v. Norton (1970), 45 Wis. 2d 389, 395, 173 N. W. 2d 297.
The objective of eradicating substandard housing is plain; however, defendant's appeal centers on the methods of reaching that objective. The issue defendant has raised is whether the legislature and common council of the city of Milwaukee intended that the housing code be an implied covenant mutually dependent with a tenant's covenant to pay rent, and thereby utilize rent withholding as a means of enforcing the housing code.
Defendant has referred this court to Brown v. Southall Realty Co. (D. C. 1968), 237 Atl. 2d 834, wherein the court held a lease void as an illegal contract because of *179 housing code violations. In Brown the tenant refused to pay rent after discovering the house she rented contained certain defects in violation of the Washington, D. C. housing regulations. The violations consisted of an obstructed commode, a broken railing, and insufficient ceiling height in the basement. Prior to entering into the lease the landlord was served with formal notice of a violation by the District of Columbia Housing Division of the Department of Licenses and Inspections. The notice informed him that violations of the housing regulations prohibited use of the basement as a dwelling place. However, the landlord failed to disclose this to the tenant. Sometime after the tenant had taken possession the house was again inspected by the housing division and the tenant was told of the violations. At the trial the tenant testified she withheld the rent because of the landlord's failure to correct the violations and because she felt the house would be condemned. In holding the lease agreement void, the court stated that a contract "made in violation of the statutory prohibition designed for police or regulatory purposes, is void and confers no right upon the wrongdoer." Brown v. Southall Realty Co., supra, quoting from Hartman v. Lubar (1942), 77 U. S. App. D. C. 95, 133 Fed. 2d 44, 45, certiorari denied, 319 U. S. 767, 63 Sup. Ct. 1329, 87 L. Ed. 1716.
However, in Saunders v. First National Realty Corp. (D. C. 1968), 245 Atl. 2d 836, the District of Columbia Court of Appeals refused to extend their holding in Southall. Saunders was an action brought by a landlord against tenant for possession because of nonpayment of rent. One of the arguments made by the tenants on appeal was that violations of the housing regulations occurring during the tenancy, which the landlord fails to correct, renders the lease illegal and void. This argument was rejected.
"... Our holding in Southall was that where the owner of dwelling property, knowing that Housing Code violations exist on the property which render it unsafe *180 and unsanitary, executes a lease for the property, such lease is void and cannot be enforced. We did not hold and we now refuse to hold that violations occurring after the tenancy is created void the lease." Saunders v. First National Realty Corp., supra, pages 837, 838.
The court also rejected the claim that the housing regulations had abrogated the common-law relation between landlord and tenant so as to create a contractual duty on the landlord to comply with the regulations.
"... We find nothing in the Housing Regulations expressly or necessarily implying that a contractual duty is imposed on the landlords to comply with the Regulations. There are express provisions for punishment by fine or imprisonment, or suspension or revocation of a landlord's housing business license, as sanctions for violations of the Regulations. In some jurisdictions where similar penalties have been imposed, the enacting body has gone farther and provided a variety of tenant remedies, but we have no such provision here. Where, as here, the regulations or statute merely impose a penalty for failure to repair and maintain the leased premises in a habitable condition the courts have refused to enlarge the scope of the landlord-tenant relation by subjecting the landlord to implied contractual obligations.
".... "Our conclusion is that under the established law of this jurisdiction the landlord's violations of the Housing Regulations is not a defense to his action for possession based on nonpayment of rent." Saunders v. First National Realty Corp., supra, pages 838, 839.
In determining whether the violation of a statute or ordinance[3] is intended to render void or unenforceable a contract, the intent and purpose of the objectives of the legislature and common council must be ascertained.
"... To determine whether a statute such as that with which we are concerned is intended to render unenforceable contracts which conflict with its provisions, the intent *181 and purpose of the legislature should be considered and ascertained.
"In Laun v. Pacific Mut. Life Ins. Co. (1907), 131 Wis. 555, 563, 111 N. W. 660, quoting from Pangborn v. Westlake (1873), 36 Iowa 546, we said:
"`"We are therefore brought to the true test, which is that while, as a general rule, a penalty implies a prohibition, yet the courts will always look to the language of the statute, the subject matter of it, the wrong or evil which it seeks to remedy or prevent, and the purpose sought to be accomplished in its enactment; and if from all these it is manifest that it was not intended to imply a prohibition or to render the prohibited act void, the courts will so hold, and construe the statute accordingly."'
"Speaking of the rule often stated, and very often by way of dictum, that contracts made in violation of a statute are unenforceable, it was said in Menominee River Boom Co. v. Augustus Spies L. & C. Co. (1912), 147 Wis. 559, 579, 132 N. W. 1118, quoting from Deming v. State ex rel. Miller (1864), 23 Ind. 416:
"`"It is a grave error to regard it as a merely arbitrary rule, applicable to all contracts which are prohibited by statute."'
"`Legislative intent must be sought in each particular case, and though it is generally true that the imposition of a penalty for entering into a bargain or performing an act that is the subject matter of the bargain makes the bargain illegal, that is not invariably the case.' Restatement, 2 Contracts, p. 1088, sec. 580, comment a.
"For the proper construction of the statute it is not enough that only its terms be considered. Its effect must be deduced from a consideration of it and other statutes on the same subject, Ocean A. & G. Corp. v. Combined Locks P. Co. (1916), 162 Wis. 255, 156 N. W. 156, and the applicable rules of the common law." Chapman v. Zakzaska (1956), 273 Wis. 64, 66, 67, 76 N. W. 2d 537.
The ordinances which defendant claims were violated in this case contain such phrases as "reasonably good state of repairs;" "clean and sanitary condition;" "adequately;" "reasonably good working conditions;" and other general terms which leave a great deal of discretion to those enforcing the code. In addition, there are no standards for differentiating between consequential and *182 inconsequential violations. Thus, the common council has indicated an intent that the housing code be enforced administratively and not by terms implied in a lease. Saunders v. First National Realty Corp., supra.
Other indicia of this intent are the enforcement procedures of secs. 75-1 through 75-18. Sec. 75-2 provides that the commissioner of health "shall make inspections to determine the condition of dwellings ..." within the city of Milwaukee. Sec. 75-3 sets forth the method of enforcement which includes service of written notice by the commissioner of health whenever there has been a violation; hearings before the commissioner which can be requested by "[a]ny person affected by any notice which has been issued in connection with the enforcement of any provision of this chapter ...;" empowering the commissioner of health, after a hearing, to sustain, modify or withdraw the notice; review by the circuit court by certiorari; and the power of the commissioner to issue subpoenas. In addition, sec. 75-18 sets forth penalties, including imprisonment, for the violation of any order of the commissioner of health based on the provisions of secs. 75-1 through 75-18.
These ordinances implement a method of enforcement based entirely upon orders issued by the commissioner of health. Holding that the housing code is implied in lease agreements would have more than a complementary effect it would circumvent the existing enforcement procedures. Instead of the commissioner issuing an order to initiate enforcement, a tenant would withhold rent and the case would then be taken into court by the landlord for ejectment, nonpayment of rent, or both. Orders would be forthcoming, not from a commissioner but from a judge, and judicial definition of terms in the housing code would supplant administrative regulation.
Some states recognize rent withholding in considering the problems of substandard housing; however, those states have done so by legislation.[4] Neither the legislature *183 nor the common council of Milwaukee has adopted any legislation from which this court can infer an intent that rent withholding under an oral month-to-month lease agreement be utilized as a means of enforcing the housing code.
We are of the opinion that the defendant does not have an affirmative defense based upon alleged violations of the Milwaukee Housing Code; and there was, therefore, no prejudicial error committed by the trial court in refusing to admit evidence based upon that contention.
By the Court.Judgment affirmed.
NOTES
[1]  "234.17 Lessee may surrender premises, when. Where any building, which is leased or occupied, is destroyed or so injured by the elements, or any other cause as to be untenantable, and unfit for occupancy, and no express agreement to the contrary has been made in writing, the lessee or occupant may, if the destruction or injury occurred without his fault or neglect, quit and surrender possession of the leasehold premises, and of the land so leased or occupied; and he is not liable to pay to the lessor or owner, rent for the time subsequent to the surrender."
[2]  Secs. 75-1 through 75-19 of the Milwaukee Code have since been repealed and the sections relating to living conditions and housing are now in Ch. 51 of the Milwaukee Code of Ordinances. Ord. 460, File no. 65-2052-f, passed Dec. 6, 1968.
[3]  It is assumed, arguendo, that there were in fact housing code violations existing the months of January and February, 1968, in the residence rented by defendant.
[4]  For example, see: New York Real Property Actions Law, McKinney Consol. Laws, c. 81, 769 et seq.; Cal. Civ. Code sec. 1942; 9 N. Dak. Century Code sec. 47-16-13. See also Peters v. Kelly (1968), 98 N. J. Super. 441, 237 Atl. 2d 635, which discusses a City of Newark ordinance enacted pursuant to N. J. S. A. 40:48-2.12a et seq., which, inter alia, empowers a director, with the approval of the municipal council, to apply for the appointment of a rent receiver for the purpose of collecting the rents and applying the same to required repairs.
