So hot stars, like cool stars, will show no hydrogen absorption lines in the optical. In fact, hydrogen absorption occurs only over a range of temperatures. If the star is too cool, hydrogen doesn't absorb. If the star is too hot, hydrogen doesn't absorb. Thus, if one sees strong hydrogen absorption, the star must be of intermediate temperature.
Similar arguments apply to other elements as well.
For example, helium absorption only occurs in the very hottest stars. Calcium and other metal lines are strong at cooler temperatures. Absorption by molecules only happens in the very coolest stars. By examining the spectrum of a star and noticing which absorptions are present, it is possible to estimate the star's surface temperature extremely accurately. When astronomers began studying stellar spectra about 100 years ago, atomic physics hadn't been invented yet.