I am trying to figure out the best way of nesting tikz nodes having a different background color. I would like the "inner" nodes to "win" concerning the background color. Currently the "outer" node ("fit") always "wins". Is there maybe a better way to aproach this?
A simple example: Nesting an inner node with background color red within an outer node with background color blue:
\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{fit}
\begin{document}
% \begin{tikzpicture}%
% \node (inner) [draw] {foo-inner};%
% \node (outer) [draw,fit=(inner)] {};%
% \end{tikzpicture}%
% \begin{tikzpicture}%
% \node (inner) [draw,fill=red] {foo-inner};%
% \node (outer) [draw,fit=(inner)] {};%
% \end{tikzpicture}%
\begin{tikzpicture}%
\node (inner) [draw,fill=red] {foo-inner};%
\node (outer) [draw,fill=blue,fit=(inner)] {};%
\end{tikzpicture}%
\end{document}%



fill opacityas in\node (outer) [draw,fill=blue,fit=(inner),fill opacity=0.5] {};, or simply reverse the order. – Peter Grill Jan 22 '12 at 23:30