Context. There have been many investigations of the optical variability of flat-spectrum radio quasars (FSRQs), but the optical variability of steep-spectrum radio quasars (SSRQs) has been poorly studied. Aims. We investigate the optical variability of SSRQs, comparing this with the optical variability of FSRQs. Methods. We measure the optical variability of 18 SSRQs and 15 FSRQs in the SDSS Stripe 82 region using SDSS DR7 released multi-epoch data covering about nine years. We determine the spectral index by fitting a power law to SDSS ugriz photometric data, and explore the relationship between this spectral index and source brightness. Results. For all SSRQs studied, we detect variations in r band flux of overall amplitude between 0.22 mag and 0.92 mag in different sources. Eight of 18 SSRQs display a bluer-when-brighter (BWB) trend. In contrast, the variability amplitude of 15 FSRQs in r band ranges from 0.18 to 0.97 mag, and 11 of 15 sources follow a BWB trend. For all SSRQs studied, we found an anti-correlation between the Eddington ratio and the variability amplitude in r band, which is similar to that in radio-quiet AGNs. This implies that the thermal emission from the accretion disk may be responsible for the variability in SSRQs, although the jet nonthermal emission cannot be excluded. In contrast, there is no correlation found for FSRQs, which implies that the mechanisms of variability in FSRQs may be different from that in SSRQs. The optical continuum variability of radio-loud broad absorption-line quasars (BALQs) are investigated for the first time here for two sources with steep radio spectra. Both radio-loud BALQs display variations with amplitudes of about 0.3 mag at r band. Their spectral variability all follow a BWB trend. In our previous analysis of a combined sample of 18 SSRQs and 44 FSRQs, we found that the line width of the broad Mg II emission line is broader for steeper radio spectral indices. It implies a disk-like broad line region (BLR) geometry may present in these quasars. In these 62 quasars, we found a ∼57% source percentage showing BWB trend in FSRQs, whereas it is ∼44% in SSRQs.