I wan’t to add a linebreak in the content of a ::before
using a dataset.
Here is my code:
HTML:
<span id="timer-container" title="11" data-average="0:00 a 0:00">
<p id="hours">0</p>
<p class="seperation">:</p>
<p id="minutes">0</p>
<p class="seperation">:</p>
<p id="seconds">0</p>
<p class="seperation">.</p>
<p id="milliseconds">00</p>
</span>
CSS:
#timer-container::before {
content: attr(data-average);
white-space: pre;
font-size: 17px;
}
2
Answers
I do not understand why this works when using A does not but put it here in case it helps.
In the text editor (notepad++) I just typed in a newline instead of the a and it works:
Instead of
A
use the numeric entity reference