div.only-before::before {
    content: 'JustBefore';
}

div.only-after::after {
    content: 'JustAfter';
}

div.both::before {
    content: 'BothBefore';
}

div.both::after {
    content: 'BothAfter';
}

#dom-node {
    background-color: white;
    color: black;
    font-family: sans-serif;
    font-size: 20px;
    height: 400px;
    width: 400px;
}