We present a high spatial resolution CCD surface photometry study in the optical V, R and I broad-band filters of a sample of 15 HII galaxies. Narrow-band imaging allows the separation of the emission-line region from the extended parts of the galaxy. The latter are assumed to represent the underlying galaxy in HII galaxies; thus the colours of the underlying galaxy are measured. The colours of the underlying stellar continuum within the starburst are also derived by subtracting the contribution of the emission lines falling in the broad-band filters. The distribution of colours of the underlying galaxy in H II galaxies is similar to the colours of other late-type low surface brightness galaxies, which suggests a close kinship of these with the quiescent phases of H II galaxies. However, comparison wtih recent evolutionary population synthesis models shows that the observational errors and the uncertainties in the models are still too large to put strict constraints on their past star formation history. Our analysis of the morphology and structural properties, from contour maps and luminosity profiles, of this sample of 15 HII galaxies agrees with what has been found by Telles and Telles, Melnick & Terlevich, namely that H II galaxies comprise two broad classes segregated by their luminosity; Type I H II galaxies are luminous and have disturbed and irregular outer shapes, while Type II H II galaxies are less luminous and have regular shapes. The outer parts of their profiles are well represented by an exponential, as in other types of known dwarf galaxy.