How to create a filled colored box in Beamer?

The 'shortest' example to show the basic usage of beamercolorbox.

Please note that there are 'better/nicer' boxes such as beamerboxrounded or tcolorbox package to produce such setup.

\documentclass{beamer}

\usepackage{blindtext}
\begin{document}
\begin{frame}{Foo}
  \setbeamercolor{coloredboxstuff}{fg=yellow,bg=white!10!blue}
  \begin{beamercolorbox}[wd=0.9\textwidth,sep=1em]{coloredboxstuff}
    \blindtext
    \end{beamercolorbox}
\end{frame}
\end{document}

enter image description here


Not sure what you are actually trying to do, but the beamer way is probably using blocks:

\documentclass{beamer}
\usecolortheme{rose}

\setbeamerfont{structure}{series=\bfseries}
\setbeamerfont{alerted text}{series=\bfseries}

\begin{document}

\begin{frame}{Test}
  \begin{block}{}
    This is a \structure{very}, \alert{long} and \structure{stupid} 

    line of text without purpose
  \end{block}
\end{frame}

\end{document}

enter image description here