  In this work we study how the cosmological parameter, the Hubble constant
$H_0$, can be constrained by observation of very high energy (VHE)
$\gamma$-rays at the TeV scale. The VHE $\gamma$-rays experience attenuation by
background radiation field through $e^+e^-$ pair production during the
propagation in the intergalactic space. This effect is proportional to the
distance that the VHE $\gamma$-rays go through. Therefore the absorption of TeV
$\gamma$-rays can be taken as cosmological distance indicator to constrain the
cosmological parameters. Two blazars Mrk 501 and 1ES 1101-232, which have
relatively good spectra measurements by the atmospheric Cerenkov telescope, are
studied to constrain $H_0$. The mechanism constraining the Hubble constant
adopted here is very different from the previous methods such as the
observations of type Ia supernovae and the cosmic microwave background.
However, at $2\sigma$ level, our result is consistent with other methods.
