Is it possible to do "and commented:" (when there is a comment, obviously) inline after objectname without adding additional classes or shell elements? I would like to make it as simple as possible. I can do this by adding a wrapper to the comment, but that's not very much.
DOES NOT WORK:
.username, .objectname { font-weight:bold; } .objectname:before {content: "'"; } .objectname:after { content: "'"; } .comment { font-style: italic; display: block; margin: 3px 0px 3px 0px; background-color: pink; } .comment:before {content: "and commented:"; display:inline; background-color: purple;} .eventtime { display: block; background-color: yellowgreen;margin: 3px 0px 3px 0px; color: #A1A1A0; } <div class="item"> <span class="username">Some Person</span> completed the task <span class="objectname">A Random Task</span> <span class="comment">silly comment silly comment silly comment silly comment silly comment silly comment silly</span> <span class="eventtime">Today @ 12:37PM</span> </div>
WORKERS:
.username, .objectname { font-weight: bold; } .objectname:before {content: "'";} .objectname:after { content: "'"; } .comment { font-style: italic; display: block;margin: 3px 0px 3px 0px; background-color: pink;color: #919190;} .commentwrapper:before {content: "and commented:"; display:inline; background-color: purple;} .eventtime { display: block; background-color: yellowgreen;margin: 3px 0px 3px 0px; color: #A1A1A0; } <div id="item1" class="item"> <span class="username">Some Person</span> completed the task <span class="objectname">A Random Task</span> <span class="commentwrapper"> <span class="comment">silly comment silly comment silly comment silly comment silly comment silly comment silly comment silly comment silly comment silly comment silly comment silly comment</span> </span> <span class="eventtime">Today @ 12:37PM</span> </div>
source share