\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{positioning}
\usetikzlibrary{fit}
\begin{document}
\tikzset{
box/.style = {draw, text width=4cm, rounded corners=2pt, align=center, fill=white, fill opacity=0.8, text opacity=1},
}
\begin{tikzpicture}[node distance=0.25cm]
\node [box] (A) {A};
\node [box, below right=3cm of A] (B) {B} edge (A.east);
\node [fit=(A)(B), draw, inner sep=0.75cm] {} node [above left, fill=yellow!20, draw] {Box title};
\end{tikzpicture}
\end{document}
which produces
I want the edge to run from A.east
to B.west
but I don't know how to accomplish this with edge
.
I know I can use \draw (A.east) -- (B.west);
but I have so many nodes, so I think it's better to draw the edges when I'm also drawing the nodes instead of drawing all the lines after I have drawn all the nodes.
Besides, how can I place the node with text Box title
in the upper left corner of the fitted box?