I am trying to put a line over a paragraph in LaTeX. I tried this code:
\noindent\makebox[\linewidth]{\rule{\textwidth}{2pt}}
\noindent\colorbox{gray}{\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\textbf{Text}}}
But there is a small space between the line and the paragraph as shown in this image:

Do you know how I can remove this space between the paragraph and the text?