In order to hide hover cards for inactive apps in taskbar of Windows 11, go to Settings > Personalization > Taskbar > Taskbar behaviors > Uncheck “Show hover cards for inactive and pinned taskbar apps ...
The Windows 11 taskbar may look modern, but it's surprisingly rigid. Beyond a few basic tweaks, Microsoft gives you very little room to personalize, even less than in previous versions of Windows.