答案1
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[titlerect/.style={draw,inner ysep=2ex,inner
xsep=1ex,minimum width={2*width("#1")},align=center,label={[anchor=center,fill=white,font=\Large\bfseries\sffamily]above:#1}}]
\node[titlerect={The title}] at (0,0) {The content\\ more content};
\end{tikzpicture}
\end{document}
不过,使用 tcolorbox 可能更适合。