Why the code is not completely working?

https://codepen.io/Jeerjmin/pen/MrKgRW
Why the first two images do not animate on hover.
The differences in the HTML code between the first two blocks and all the others in that they are written in multiple lines.
How to write code in multiple lines, but, moreover, to work ?

My previous question was deleted I do not understand why, maybe the problem is not solved and the question is still open. Perhaps due to the caller's name or my wording, but please forgive me I'm not experienced with this and don't understand what's the difference ?
June 10th 19 at 14:20
1 answer
June 10th 19 at 14:22
Solution
The difference is that the newline is a character and this means that child nodes will appear in the text, so that links
var overlay = this.childNodes[1];
var image = this.childNodes[0];

will be incorrect, and therefore your animation will not work. In this case, just look for the element inside the element, instead of a search node. Try to debug your code before you write your question, debug, all our

Find more questions by tags SassWeb DevelopmentCSSJavaScript