We follow the chemical evolution of a galaxy through star formation an
d its feedback into the interstellar medium (ISM), starting from primo
rdial gas and allowing for gas to inflow into the region being modelle
d. We attempt to reproduce observed spectral line strengths for early-
type galaxies in order to constrain their star formation histories (SF
H). The efficiencies and times of star formation are varied, as are th
e amount and duration of inflow. We evaluate the chemical enrichment a
nd the mass of stars made with time. Single stellar population (SSP) d
ata are then used to predict line strengths for composite stellar popu
lations. The results are compared with observed line strengths in 10 e
llipticals, including some features which help to break the problem of
age-metallicity degeneracy in old stellar populations. We find that t
he elliptical galaxies modelled require high metallicity SSPs (> 3 Z(.
)) at later times. In addition, the strong lines observed cannot be pr
oduced by an initial starburst in primordial gas, even if a large amou
nt of inflow is allowed for during the first few x 10(8) yr. This is b
ecause some preenrichment is required for lines in the bulk of the sta
rs to approach the observed line strengths in ellipticals. These stron
g lines are better modelled by a system with a delayed burst of star f
ormation, following an early SFH which can be a burst or more steady s
tar formation. Such a model is representative of star formation in nor
mal ellipticals or spirals, respectively, followed by a starburst and
gas inflow during a merger or strong interaction with a gas-rich galax
y. Alternatively, a single initial burst of normal stars with a Salpet
er initial mass function could produce the observed strong lines if it
followed some pre-enrichment process which did not form long-lived st
ars (e.g. population III stars).