Absolute differential cross sections for elastic $p^7$Be and $p^8$B small-angle scattering were measured in inverse kinematics at an energy of 0.7 GeV/u at GSI Darmstadt. The hydrogen-filled ionization chamber IKAR was used as an active target to detect the recoil protons. The projectile tracking and isotope identification were performed with multi-wire proportional chambers and scintillation detectors. The measured cross sections were analysed using the Glauber multiple-scattering theory. The root-mean-square (rms) nuclear matter radii $R_{rm m} = 2.42 (4)$ fm for $^7$Be and $R_{rm m} = 2.58 (6)$ fm for $^8$B were obtained. The radial density distribution deduced for $^8$B exhibits a proton halo structure with the rms halo radius $R_{rm h} = 4.24 (25)$ fm. A comparison of the deduced experimental radii is displayed with existing experimental and theoretical data.