We give a generalization of the Stone-Weierstrass property for subalgebras of C(X), with X a completely regular Hausdorff space. In particular, we study in this paper some subalgebras of C0(X), with X a locally compact Hausdorff space, provided with weighted norm topology. By using the Stone-Weierstrass property, we then describe the ideal structure of these algebras.