Dear Sofia @sofiapapa08
If its going to be different text on each project then coding in for every image would take ages - Therefore using something built in is better - like captions.
Then you only have to target the captions <div> and make it appear on hover but the data inside (text) will be called automatically for you.
The principles of the example you provided: https://www.w3schools.com/css/tryit.asp?filename=trycss_tooltip
Are the same that you would use to make the captions appear
visibility:0 to visibility:1
or
opacity:0 to opacity:1
or
display:none to display:block
Also for help:
https://laytheme.com/documentation.html#custom-css-styling
Best wishes :)
Richard