The Lyman decrement associated with the cumulative effect of H i in QSO absorption systems along the line of sight provides a distinctive feature for identifying galaxies atz ≳ 2.5. Colour criteria, which are sensitive to the presence of a Lyman continuum break superposed on an otherwise flat UV spectrum, have been shown, through Keck spectroscopy, to successfully identify a substantial population of star-forming galaxies at 3≲z≲3.5. Such objects have proven to be surprisingly elusive in field galaxy redshift surveys; quantification of their surface densities and morphologies is crucial for determining how and when galaxies formed. The Hubble Deep Field (HDF) observations offer the opportunity to exploit the ubiquitous effect of intergalactic absorption and obtain useful statistical constraints on the redshift distribution of galaxies to considerably fainter limits than the current spectroscopic limits. We model the H i cosmic opacity as a function of redshift, including scattering in resonant lines of the Lyman series and Lyman continuum absorption, and use stellar population synthesis models with a wide variety of ages, metallicities, dust contents and redshifts to derive colour selection criteria that provide a robust separation between high-redshift and low-redshift galaxies. From the HDF images we construct a sample of star-forming galaxies at 2≲z≲4.5. While none of the ∼ 60 objects in the HDF having known Keck/Low-Resolution Imaging Spectrograph (LRIS) spectroscopic redshifts in the range 0≲z≲1.4 is found to contaminate our high-redshift sample, our colour criteria are able to efficiently select the 2.6≲z≲3.2 galaxies identified by Steidel et al.