Spin-resolved scanning tunneling spectroscopy measurements at low temperatures were performed for Co nanostructures on Pt(111). On Co monolayer islands and wires the electronic structure changes on the scale of a few atoms due to the changing local stacking of the Co atoms. First-principles calculations for pseudomorphic fcc and hcp stacked Co monolayers assign the dominant feature in the measured spectra to a d-like surface resonance of minority-spin character which shifts in energy because of a different coupling to the Pt substrate. Despite the heterogeneous electronic structure of the Co monolayer, the out-of-plane magnetized domains are clearly observed. While the domain wall width measured on wires is less than 4 nm there is no indication for a change in the magnetization direction for islands with a base length up to fifteen times the domain wall width. Furthermore, the magnetic hysteresis in an ensemble of out-of-plane magnetized Co monolayer as well as double-layer nanostructures was observed. While the coercivity for the monolayer nanostructures is about 0.25 T, double-layer islands show surprisingly large coercivities of more than 2 T.