# Border on top of paragraph

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?

-

## migrated from stackoverflow.comAug 22 '12 at 13:51

This question came from our site for professional and enthusiast programmers.

\noindent\makebox[\linewidth]{\rule{\textwidth}{2pt}}\par