In any court situation, the biological parents of a child have superior rights over all other individuals to retain custody of that child. Having said that, it's quite possible, and there are many ways in which a person could transfer custody of a child to a stepparent upon the parent's death. Ideally this is set up through legal documentation before the death of the biological parent.
Transferring Custody to a Stepparent
The primary consideration regarding whether or not you can transfer custody to your new husband is whether the child can be considered as being involved in a family relationship with the stepparent.
Keep in mind that the biological parent does still have superior rights to the child over the stepparent. Between the two, the biological parent will receive custody unless there is a valid reason for that not to happen, such as that parent is unsuitable or does not wish to obtain custody. The best you can do is try to arrange documentation in such a way that it expresses your wishes, and perhaps sit down for a conversation with your ex regarding what you would both like for the child in case one of you dies.
Getting Help
If you wish to try to transfer custody to your new husband, you should strongly consider speaking with a lawyer, now, about your legal options for ensuring that custody of your child would go to your husband in the event of your death, as opposed to going to his biological father.