  We investigate the size--density relation in extragalactic HII regions, with
the aim of understanding the role of dust and different physical conditions in
the ionized medium. First, we compiled several observational data sets for
Galactic and extragalactic HII regions and confirm that extragalactic HII
regions follow the same size (D)--density (n) relation as Galactic ones.
Motivated by the inability of static models to explain this, we then modelled
the evolution of the size--density relation of HII regions by considering their
star formation history, the effects of dust, and pressure-driven expansion. The
results are compared with our sample data whose size and density span roughly
six orders of magnitude. We find that the extragalactic size--density relation
does not result from an evolutionary sequence of HII regions but rather
reflects a sequence with different initial gas densities (``density
hierarchy''). Moreover, the size of many HII regions is limited by dust
absorption of ionizing photons, rather than consumption by ionizing neutral
hydrogen. Dust extinction of ionizing photons is particularly severe over the
entire lifetime of compact HII regions with typical gas densities of greater
than 10^3 cm^{-3}. Hence, as long as the number of ionizing photons is used to
trace massive star formation, much star-formation activity could be missed.
Such compact dense environments, the ones most profoundly obscured by dust,
have properties similar to ``maximum--intensity starbursts''. This implies that
submillimeter and infrared wavelengths may be necessary to accurately assess
star formation in these extreme conditions both locally and at high redshift.
