In this tutorial written by MARY LOU we’re going to show you some simple CSS tricks using data attributes and pseudo-elements. The aim is to create an image caption using only an anchor and an image as markup. We’ll be exploring how to create pseudo-elements from some data attribute values and use them in a hover effect or simply show them next to the image. Using (more) semantic markup is of course what you should be doing, especially for data that is important to be shown.
Demo: http://tympanus.net/Tutorials/PseudoElementsImageCaptions/
Download: http://tympanus.net/codrops/2013/07/05/using-custom-data-attributes-and-pseudo-elements/
Download: http://tympanus.net/codrops/2013/07/05/using-custom-data-attributes-and-pseudo-elements/