Gravitational waves (GWs) from compact binary coalescences (CBCs) offer a novel method to probe cosmic expansion, particularly the Hubble constant H0. A key technique in GW cosmology is the spectral sirens method, which utilizes GW luminosity distance and source-frame mass distribution to infer redshift. With GW detectors, populations of CBCs can be either observed as resolved individual sources or implicitly as a stochastic gravitational-wave background (SGWB) from the unresolved ones. This study explores how both resolved and unresolved CBCs contribute to constraining cosmic expansion within the spectral siren framework. The SGWB provides additional constraints on CBC population properties, potentially enhancing precision in cosmic expansion measurements. Using a five-detector network at O5-designed sensitivity, we find that incorporating the SGWB helps exclude lower values of H0 and the dark matter energy fraction Ωm. It also helps in refining the redshift distribution of CBCs, improving the determination of a possible CBC peak in redshift. However, while SGWB improves constraints on low values of H0 and Ωm, resolved spectral sirens remain the dominant source of precision for H0. We also performed a spectral siren analysis for 59 resolved binary black hole sources detected during the third observing run with an inverse false alarm rate higher than 1 per year jointly with the SGWB. We obtain that with current sensitivities, the cosmological and population results are not impacted by the inclusion of the SGWB.