That will match images whose name ends in "gif", but won't match "/foo.GIF" or simply a "/foo" that is a GIF. You can't tell what content type the server thinks the image is until you get the content-type header, and you can't tell what it actually is until it's been downloaded.
Most gifs being served on the web aren't .gif files anymore, but .webm or .mp4 files instead. That css wouldn't even stop half of the gifs most users see on a daily basis.
edit: at least it prevents them from being displayed :P