I have found this tread on how to construct a box around content and liked the idea quite a lot. I have used it on a few places but ran into a little problem now.
I have a box that is about 3/4 of a page tall and kind of rips my document apart. What I would like to do is that this box is floating while all of the other boxes should remain where they are.
It would also be great if these boxes could have captions like tables have but I would like for them to be placed in the "title" section of the frame. If that is possible.
Below I have attached the source code of an example about the placement. In the first section there is to much white on the first page and in the second section it's not all that much better.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{lipsum}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=black!5!white,colframe=blue!75!black}
\newtcolorbox{myboxtitle}[1]{colback=green!5!white,colframe=green!75!white,title=#1} %fonttitle=\bfseries
\begin{document}
\section{How it is}
\lipsum[7]
\begin{myboxtitle}{Naming Convention for CC}
\lipsum[2]
\end{myboxtitle}
\lipsum[8]
\begin{myboxtitle}{Naming Convention for CC}
\lipsum[3]
\begin{minipage}[t][4.2cm][c]{\linewidth}
\end{minipage}
\lipsum[6]
\end{myboxtitle}
\lipsum[7-10]
\newpage
\section{How it would be better}
\lipsum[7]
\begin{figure} %this should be the new environment. Would be great to combine with the box
\begin{myboxtitle}{Naming Convention for CC}
Well, this should not float to the top!
\end{myboxtitle}
\end{figure}
\lipsum[8]
\begin{figure}
\begin{myboxtitle}{Naming Convention for CC}
\lipsum[3]
\begin{minipage}[t][4.2cm][c]{\linewidth}
\huge This box should not be alone on one page.
\end{minipage}
\lipsum[6]
\end{myboxtitle}
\end{figure}
\lipsum[7-12]
\end{document}
Thanks for your help!

tocbasicprovides a command\DeclareNewTOCthat sets up a new environment, the name, the name for the list of, the list of, the counter ... – Johannes_B Apr 09 '15 at 16:51tcolorboxcan be made floating iffloatoption is used ;-) – Apr 09 '15 at 19:17