Bolding text inserted via :before

  • Author
  • #1593398

    What I want div.under_work:
    <div class=”under_work”>Notice: Currently Under Construction</div>
    <div class="under_work"> <em>Currently Under Construction</em></div>

    My current markup for this “template”:
    <div class="under_work"><strong>Notice: </strong> <em>Currently Under Construction</em></div>

    From a commented-out portion of my CSS:

    div.under_work p:before {
    	content:"Notice: "

    When I tried adding markup to the content part, it simply ignored the markup and put the text in without any changes. Also, when I used :before, I got a new “Notice”: before the original “Notice:” text, but it wasn’t bold, either.

    How do I add a bold “Notice:” without emphasis on it, and without bolding the other text in the div?

    The blog I need help with is


    EDIT: What I want [to change with] div.under_work [in CSS]:


    It looks like you may have gotten this straightened out. If not, can you try explaining it a little more? I’m not seeing why you need the :before when you can just code it and copy/paste into pages under construction.


    Good point, but I want to be able to change it from one place, like in Wikipedia templates.



    You remove this from the Text editor:
    <strong>Notice: </strong>
    and you turn this:

    div.under_work strong {
    font-size: 24px;
    word-spacing: 2px;

    to this:

    div.under_work:before {
    Content: "Notice: "
    font-size: 24px;
    font-weight: bold;
    word-spacing: 2px;


    Thanks. :)



    You’re welcome!

The topic ‘Bolding text inserted via :before’ is closed to new replies.