# How to adust the location of the inner component in the Outer component constructed by “fit”?

I use "fit" to make two small rectangles inside a bigger rectangle. And then add some words at the top of the bigger one, which causes a large blank space at the bottom of the bigger rectangle as showed in the following photo. However, I wish to get the graph that there is no blank at the bottom of the outside rectangle and almost no space between word and the top small rectangle. Could some one Help me?

\documentclass[tikz]{standalone}
\usetikzlibrary{
shapes.geometric,
positioning,
fit,
calc
}
\usetikzlibrary{decorations.markings}
\usepackage{tikz}
\newcommand*{\Shift}{0.6ex}
\begin{document}

\tikzset{
my box/.style = {draw, minimum width = 3em, minimum height=1em},
}
\begin{tikzpicture}[node distance=5mm]
\node[my box,align=center](a) {get flight\\(gf)};
\node[my box,align=center,below=of a] (b) {book flight\\(bf)};
\draw[->] (a) -- (b);

\node[draw, fit=(a) (b),minimum height=4cm] (ab) {};

\node[below=0.3mm of  ab.north,align=center](flight) {ontessage\\ jeusts};

\end{tikzpicture}
\end{document}

-
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Kurt Feb 15 '13 at 14:19
@Kurt I have edited it and added the MWE,THANKS –  sweetyBaby Feb 15 '13 at 14:29
@Jake thanks for reminder :) have added it. –  sweetyBaby Feb 15 '13 at 14:30

The blank space at the bottom does not come from the label, but from the fact that you're using minimum height=4cm for the ab node. What I would do is to add the label first using a node that's placed above a, and then fit the large box around the two boxes and the label node:

\documentclass[tikz, border=5mm]{standalone}
\usetikzlibrary{
shapes.geometric,
positioning,
fit,
calc
}
\usetikzlibrary{decorations.markings}
\usepackage{tikz}
\newcommand*{\Shift}{0.6ex}
\begin{document}

\tikzset{
my box/.style = {draw, minimum width = 3em, minimum height=1em},
}
\begin{tikzpicture}[node distance=5mm]
\node [my box,align=center](a) {get flight\\(gf)};
\node [my box,align=center,below=of a] (b) {book flight\\(bf)};
\node [above=1ex of a, align=center] (c) {ontessage\\jeusts};
\draw[->] (a) -- (b);

\node[draw, fit=(a) (b) (c)] (ab) {};

\end{tikzpicture}
\end{document}

-