If you want to achieve this effect using Javascript, as previously mentioned by @rguttersohn, you can certainly do so. However, if you prefer to stay within your current CSS framework, you'll have to adjust the content
property in your .periodic-element:after
selector and modify your html element accordingly.
<div class="periodic-element intense-work" data-description="Something" data-description-2="To" data-description-3="Break">
Take note of the new data-description-2
and data-description-3
. To reflect these changes in your CSS, you will also need to include
content: attr(data-description) "\A" attr(data-description-2) "\A" attr(data-description-3);
AS WELL AS
white-space: pre-wrap;
This adjustment will combine the various data-description attributes onto separate lines. You can view the revised version on JSFiddle.