
179 Cal.App.2d 12 (1960)
In re LILLIAN MILLER, on Habeas Corpus.
Crim No. 7100. 
California Court of Appeals. Second Dist., Div. Two.  
Mar. 18, 1960.
 David C. Marcus for Petitioner. *14
 William B. McKesson, District Attorney (Los Angeles), Harry Wood and Ralph F. Bagley, Deputy District Attorneys, for Respondent.
 Philip Silverman and Brock, Fleishman & Rykoff for Real Party in Interest.
 KINCAID, J. pro tem.  [fn. *]
 Petitioner, Lillian Miller, seeks a writ of habeas corpus following a finding that she was in contempt of an order or orders of the court. The court further found that defendant's contempt was a continuing one and by commitment "sentenced her to the County Jail until she purged herself of the contempt." She was thereupon remanded to the sheriff "to begin serving her sentence forthwith."
 Petitioner was defendant and cross-complainant in a divorce proceeding instituted by her husband Louis Miller as plaintiff. Two children were born of the marriage, Jana, age 7 and Corby, age 4. Both parents sought custody of the children. Evidence was presented that Corby is a victim of mongolism with congenital heart disease and mental defectiveness and that he needs properly supervised medical care. At the conclusion of the trial the court, on November 30, 1959, in open court and in the presence of petitioner, made its order granting an interlocutory judgment of divorce, said judgment being signed and entered December 2, 1959. The judgment provides, inter alia, that custody of Jana is awarded to defendant mother, subject to the rights of reasonable visitation by plaintiff father and custody of Corby is awarded to said father with like visitation rights.
 The judgment further provides: "It is the recommendation of the Court that said child, Corby, be placed in a suitable institution where he will receive proper care. Plaintiff and cross-defendant shall assume and pay all costs in connection with the care and custody of the child, Corby." A motion for stay of execution under section 949a, Code of Civil Procedure, of that portion of the judgment relating to the awarding of custody of Corby to plaintiff was thereupon made by defendant and denied by the court.
 On January 25, 1960, following filing of an affidavit by plaintiff alleging noncompliance by defendant of that portion of the judgment requiring her to surrender Corby into plaintiff's custody, an order to show cause in re contempt was *15 issued and served. On February 10, 1960, a hearing was held thereon by a judge other than the trial judge. Plaintiff, defendant and a witness testified and the court in part made the following order:
 "The Court finds that defendant had knowledge of the Court's order of November 20, [sic 30] 1959; that she had the ability to comply therewith, that is, to turn over physical possession of the minor child to plaintiff; that she refused to comply with such order, and that such failure was wilful. Defendant is found in contempt of court. This matter is continued to February 19, 1960, at 1:30 P. M. for sentencing. Defendant is ordered to turn physical possession of the minor child over to plaintiff this afternoon, said child to be taken to the home maintained by Mrs. Florence Berninger, 7812 Alder Avenue, Fontana, California, to await placement in Pacific State Hospital at Spadra, California."
 On February 15, 1960, defendant filed her notice of appeal from the judgment and from the contempt order of February 10, 1960, and from all orders made by the court in connection therewith.
 On February 19, 1960, defendant appeared before the court pursuant to order of February 10, 1960. The court found that she had not complied with such order but instead has at all times refused to surrender custody of the child Corby, insists on retaining its physical custody and insists that it be not institutionalized. The court further found that defendant had removed Corby from the home and has at all times since secreted the child and notwithstanding issuance of a warrant, the sheriff has been unable to locate Corby or the defendant. An order of commitment to the county jail was thereupon executed by the court reciting the foregoing proceedings and facts and defendant was sentenced until she purged herself of the contempt.
 On February 19, 1960, defendant filed a petition for writ of supersedeas (2d Civ. No. 24527) in this court staying the proceedings in the lower court including the sentencing of defendant for contempt of court. On February 25, 1960, this court issued its order as follows: "The petition for writ of supersedeas is granted to the following extent only; it is ordered that the Superior Court of the County of Los Angeles is restrained from enforcing that portion of the order of February 10, 1960, in action No. D-544957, which provides, 'Defendant is ordered to turn physical possession of the minor child over to plaintiff this afternoon, said child to be taken *16 to the home maintained by Mrs. Florence Berninger, 7812 Alder Avenue, Fontana, California, to await placement in Pacific State Hospital at Spadra, California,' until final determination of the appeal herein or until further order of this court. In all other respects, the petition is denied."
 Following the arrest of defendant under the commitment order in re contempt of February 19, she filed her within petition for writ of habeas corpus and she was ordered by this court released from custody upon her own recognizance until return of the writ or until further order of this court.
 [1] Habeas corpus may not be used as a substitute for appeal but is a proper remedy to collaterally attack a judgment of conviction which has been obtained in violation of fundamental constitutional rights. (In re Winchester, 53 Cal.2d 528 [2 Cal. Rptr. 296, 348 P.2d 904]; In re James, 38 Cal.2d 302, 309 [240 P.2d 596].) Petitioner seeks to have this court review all proceedings in the lower court resulting in the awarding of custody of Corby to plaintiff. [2] As indicated we are limited in our consideration and habeas corpus is not available to review the findings of the trial court made within the exercise of an admitted jurisdiction.
 The trial court in the exercise of a proper jurisdiction decreed that custody of the daughter be awarded to the defendant mother and of the son to the father. Neither parent was found unfit to have custody.
 [3] Insofar as any violation of fundamental rights may here be concerned it is the well-established rule that the court need not find one parent unfit to have custody before it can award the child to the other parent. [4] In awarding the custody the judge is to be guided by what appears to be for the best interests of the child. Neither parent is entitled to the custody as a matter of right. (Holsinger v. Holsinger, 44 Cal.2d 132, 135 [279 P.2d 961]; Ducharme v. Ducharme, 152 Cal.App.2d 189, 192 [313 P.2d 33]; Faulkner v. Faulkner, 148 Cal.App.2d 102, 107 [306 P.2d 585]; Civ. Code,  138.)
 [5] The feelings and desires of the parents are not to be considered except insofar as they affect the best interests of the child. (Newell v. Newell, 146 Cal.App.2d 166, 179 [303 P.2d 839].)
 [6a] Following the refusal by the trial court of any stay of execution of the custody order as contained in the interlocutory judgment of divorce and in the absence of any stay thereof by an appellate court (Code Civ. Proc.,  949a), it clearly became the duty of the defendant to surrender custody *17 of Corby to plaintiff. In awarding such custody to plaintiff the court merely recommended that the child be placed in a suitable institution where he will receive proper care. The plaintiff, as the responsible custodian, was free to decide if and where the child would be so placed. The affidavit by plaintiff of noncompliance on the part of defendant was a sufficient basis for issuance of the order to show cause in re contempt of January 25, 1960. Pursuant to the facts alleged in the affidavit and the terms of the show cause order defendant was notified that unless she complied with that portion of the judgment requiring her to surrender custody of Corby to his father she would be subject to a finding and sentence for contempt.
 Nowhere therein, however, was she notified or advised that as a part of said contempt proceedings, in addition to again ordering defendant to deliver physical possession of the child to plaintiff, the court contemplated or would order plaintiff father to deliver possession of said child to a third person or institution.
 That this is the effect of the order is shown not only by its own terms but by the wording of the commitment of defendant to the county jail wherein the court again ordered defendant to deliver physical custody of the child to plaintiff forthwith "and plaintiff father was ordered to take the minor child to an accredited state home for retarded children maintained by Mrs. ... Berninger, ... to await placement in Pacific State Hospital. ..."
 The above quoted portion of the court's order is violative of the established rule that in either guardianship or divorce custody proceedings, the parents have preference over a nonparent as to custody of a child unless the parent is found unfit. [7] Where a parent applying for custody is in a position to take the child and is not shown to be unfit the court may not award custody to strangers merely because it feels that they may be more able to provide financial, educational, social or other benefits. (Stewart v. Stewart, 41 Cal.2d 447, 451, 452 [260 P.2d 44]; Roche v. Roche, 25 Cal.2d 141 [152 P.2d 999]; Guardianship of Smith, 42 Cal.2d 91, 92 [265 P.2d 888, 37 A.L.R.2d 867].)
 Defendant, and indeed plaintiff, were entitled to proper notice of any such contemplated order of change of custody. [8] Since a charge of contempt is essentially criminal in nature, due process requires notice and an opportunity to prepare a defense before an adjudication of constructive contempt *18 can be made. (In re Wren, 48 Cal.2d 159, 164 [308 P.2d 329].)
 [6b] Defendant was not confronted with any affidavit charging her with failure to deliver custody of the child to a third person or institution, or to the father for delivery of any such custody. Without such an affidavit having been properly offered she was deprived of a trial of this issue according to established rules regulating the enforcement and protection of private rights. (Collins v. Superior Court, 150 Cal.App.2d 354, 364 [310 P.2d 103].) [9] An affidavit which forms the basis for a contempt citation will be construed in favor of the accused and its insufficiencies may not be cured by presumptions or inferences as to material facts that are not alleged. (In re Brown, 136 Cal.App.2d 40, 42 [288 P.2d 27].) [6c] Under the facts and circumstances here shown defendant has not been accorded due process in the contempt proceedings under which she was found guilty and was committed.
 The writ is granted and the petitioner is discharged from the custody of the sheriff of Los Angeles County.
 Ashburn, Acting P. J., concurred.
 HERNDON, J.
 I concur in the judgment.
 I agree that the court below exceeded its jurisdiction in ordering that the child be delivered to plaintiff "to be taken to the home maintained by Mrs. Florence Berninger, ... to await placement in Pacific State Hospital at Spadra, California. ..." I further agree that the record discloses an entirely sufficient basis for an adjudication that petitioner was guilty of contempt by reason of her wilful refusal to surrender custody of the child, Corby, to plaintiff in conformity with the provisions of the interlocutory judgment. Plaintiff may now enforce his custodial rights by any appropriate proceeding. As I interpret it, our decision here is not intended to hold or intimate that plaintiff may not properly place the child in a suitable hospital or institution whenever, in the exercise of a sound parental discretion, he determines that hospital or institutional care is necessary to protect the child's best interests. *19
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
