# How to make transparent box with shadow?

I am trying to make a box with shadow, but the filling should be transparent. However, my problem is that the shadow is showing through the transparent filling, see

The code is

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[baseline=(char.base)]
\end{tikzpicture}
\end{document}


How can I make the box with transparent filling, but the shadow not showing through the transparent filling?

To avoid seeing the shadow in the transparent area, you can put the button inside a knockout transparency group. If the background and the shadow are in the same knockout group, the group "knocks out" the shadow:(I added some background text to show the transparency of the button and text opacity to increase the contrast)

\documentclass{article}
\usepackage{kantlipsum}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[baseline=(char.base)]
\node at (0,0) {\fontsize{5pt}{0pt}\selectfont\parbox{4cm}{\kant[1]}};
\begin{scope}[transparency group=knockout]
fill opacity = 0.4, text opacity = 0.8] {Shadow};
\end{scope}[transparency group=knockout]
\end{tikzpicture}
\end{document}


Warning: Knockout groups are not supported by a lot of PDF viewers. Especially Acrobat is the only viewer I know supporting this.

A tcolorbox with a beamer style is a handy option of a more realistic appearance of translucent glass with shadow:

\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}
\tcbset{beamer,boxrule=1pt,tikz={opacity=0.8,transparency group},fontupper=\bfseries\sffamily}
\begin{document}
\lipsum[1]
\vspace{-12em}\centering