Wh… Inherits this property from its parent element. Data- attributes for configuration of widgets e.g. There should be an icon after the text. Some use I have for using attributes in content is in my print stylesheet for printing url’s. For example to show the parent data on the article you can use generated content in CSS with the attr() function:You can also use the attribute selectors in CSS to change styles according to the data:You can see all this working together in this JSBin example.Data attributes can also be stored to contain information that is constantly changing, like scores in a game. Make the cell value show up using the :after pseudo-class of the td element. tweet buttons etc. Concatenating strings is done via simple spacing: /*
*/ div[data-line]:after { content: "[line " attr(data-line) "]"; } Data-Attributes in CSS. Content is available under these licenses. The content CSS property can be used only on ::before and ::after pseudo-elements. Note that, as data attributes are plain HTML attributes, you can even access them from CSS. For example, let’s say you wanted to add some content dynamically to a component based on a data attribute value. You can't give an element a pseudo-class by using JavaScript, Default value. jQuery mobile, social media buttons and other widgets are increasingly using HTML5 data- attributes for configuration. 12.5), … There are numerous tutorials online discussing the idea of CSS-based tooltips. How to add bullet colors for