Although it's an old question, none of the answers mention tcolorbox package which provides an environment for colored and framed text boxes with a heading
line.
It declares an environment tcolorbox uses to build colored boxes which by default occupy the line width. These boxes can be completely customized, allow page breaks and can contain any kind of text (regular paragraphs, minipages, tabulars, math, ...). Some little examples look like:
\documentclass{article}
\usepackage{lipsum}
\usepackage{lmodern}
\usepackage{tcolorbox}
\begin{document}
\lipsum[2]
\begin{tcolorbox}
\lipsum[3]
\end{tcolorbox}
\begin{tcolorbox}[sharp corners, colback=green!30, colframe=green!80!blue, title=Another paragraph with title]
\lipsum[2]
\end{tcolorbox}
\begin{tcolorbox}[width=6cm]
I'm sure you know that
\[
\sin^2 x + \cos^2 = 1
\]
Don't you?
\end{tcolorbox}
\end{document}

tcolorbox package also offers the command \tcbox which builds a box adjusted to the contents. This kind of boxes are not breakable.
\documentclass{article}
\usepackage{lipsum}
\usepackage{lmodern}
\usepackage{tcolorbox}
\begin{document}
\tcbox{This is a sentence}
\tcbox[colback=blue!30, colframe=blue!30!black]{\begin{tabular}{cc}A & B \\ C & d\end{tabular}}
\tcbox[sharp corners, colframe=red, colback=red!20!blue!30]{\includegraphics[width=4cm]{example-image-A}}
\end{document}

Information about tcolorbox and all of its bells and whistles can be found in CTAN
fancyboxsupports page breaks? If so it should be also mentioned. – Martin Scharrer Feb 19 '11 at 09:11