[Tex/LaTex] Does latex have the z-index property

backgrounds

May be this is a very strange question.
But I found this property is very useful to control the overlap element.

So I wonder if latex own this property as HTML div.

Do you have any better idea to solve the overlap problem. Sometime, I need to push some
element back.

update:the MWE code



\documentclass{article}

\usepackage{listings}
\usepackage{courier}
\usepackage{caption}
\usepackage{xcolor} 
\usepackage{calc}

\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\parbox{\textwidth}{\colorbox{gray}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,
labelfont=white,
textfont=white,
singlelinecheck=false,
margin=0pt,
font={bf,footnotesize}
}

\newlength\tdima
\setlength\tdima{ \fboxsep+\fboxrule}

\lstset{
         basicstyle=\small\tt,
         tabsize=2,                  
         extendedchars=true,         
         breaklines=true,           
         mathescape,
         escapeinside={\%*}{*)},        
         showspaces=false,          
         showtabs=false,             
         showstringspaces=false,      
         columns=flexible,
         xleftmargin=\tdima,
         framextopmargin= 10pt,
         framexbottommargin=10pt,
         float=tp,                            % float setting
         frame=single,
}%

\begin{document}
\begin{lstlisting}
using namespace std;
int main(void)
{
    return 0;
}
\end{lstlisting}
\end{document}  


Output:

enter image description here

The caption overlap with the frame. And I want to push the caption back. Let the frame cover it.
I don't want to use the \vskip to fine tuning the caption position.

Best Answer

Add a dimension to \fboxsep, as follows:

  \DeclareCaptionFormat{listing}{\fboxsep=1.2pt....

enter image description here