\newtcolorbox[auto counter]{boxx}
{breakable,top=1cm,title={Exercice \thetcbcounter},enhanced,before skip=5mm,after skip=5mm,boxsep=3mm,coltitle=black,attach boxed title to top left={xshift=5mm,yshift=-\tcboxedtitleheight},boxrule=1.5pt,boxed title style={interior empty,frame code={
\fill([xshift=1mm]frame.north east)arc(180:0:1mm)([xshift=-1mm]frame.north west)arc(0:180:1mm);
\path[right color=blue!23!white,left color=blue!70!white,middle color=blue!13] ([shift={(-.2,.1)}]frame.north west)--([shift={(.2,.1)}]frame.north east)[rounded corners=1mm]--([xshift=.1cm]frame.north east)--(frame.south east)--(frame.south west)--([xshift=-.1cm]frame.north west)[sharp corners]--cycle;
}
}
答案1
欢迎!这就是关键colback
所在。例如,添加colback=red!20
收益
\documentclass{article}
\usepackage[breakable,skins]{tcolorbox}
\newtcolorbox[auto counter]{boxx}
{breakable,top=1cm,title={Exercice~\thetcbcounter},
enhanced,before skip=5mm,after skip=5mm,
boxsep=3mm,coltitle=black,colback=red!20,%<-
attach boxed title to top left={xshift=5mm,yshift=-\tcboxedtitleheight},boxrule=1.5pt,boxed title style={interior empty,frame code={
\fill([xshift=1mm]frame.north east)arc(180:0:1mm)([xshift=-1mm]frame.north west)arc(0:180:1mm);
\path[right color=blue!23!white,left color=blue!70!white,middle color=blue!13] ([shift={(-.2,.1)}]frame.north west)--([shift={(.2,.1)}]frame.north east)[rounded corners=1mm]--([xshift=.1cm]frame.north east)--(frame.south east)--(frame.south west)--([xshift=-.1cm]frame.north west)[sharp corners]--cycle;
}
}}
\begin{document}
\begin{boxx}
\begin{enumerate}
\item A
\item B
\end{enumerate}
\end{boxx}
\end{document}