CC rules aren't very permissive when it comes to Attribution. You must attribute the work visually, not only in the code, and you must provide a link to the licence, plus to other elements if provided.
"If supplied, you must provide the name of the creator and attribution parties, a copyright notice, a license notice, a disclaimer notice, and a link to the material. CC licenses prior to Version 4.0 also require you to provide the title of the material if supplied, and may have other slight differences."
See how the attribution below contains 3 links : to the image, to the author, to the licence :
You can also do this :
But EVERYTHING that isn't as complete and as visible as the two examples above isn't good at all, so the licence is breached and usage of the image fall into copyright breach/theft.
Most of the author giving you CC Attribution licences do that because they want exposure for their work, so you must provide this exposure.