• Resolved jgoldberg2013

    (@jgoldberg2013)


    have no idea as to how to do this most forums point to hardcoding and I want to do this in my chils style.css file.
    Example; div text has a little story, I want the first word of story to be a different colour and bold.

    I also want to do a hyperlink at the end the story – on “read more..” to take the reader to that page.

Viewing 11 replies - 1 through 11 (of 11 total)
  • If you want to use external CSS to target one word, then you need to use additional HTML to target that word – for example:

    This is the <span class="myword">word</span> to change.

    CSS:

    .myword {
       color: red;
       font-weight: bold;
    }

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    so any which way, I would hav to hardcode into html file.
    My concern is updates and so on, I do back up but I have always tried to do eveything with my child theme.
    Not sure if I can code html with the style.css? Maybe a stupid question, not sure.

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    is there not a first word syntax like we use the first-letter to style?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Nope.

    Your content is not lost in any update, child theme or not.

    No you cannot put HTML in a style.css file. In the example above, the first part goes in the content, the second in your child theme style.css file.

    I assumed you wanted to style text that you are entering as content. If that’s not the case, please be more specific.

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    thanks Andrew – so I HAVE to hardcode and remeber changes incase of updates later on?
    Please confirm.

    What are you changing? Content is not lost upon update.

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    I assume it is content.
    Scenario is this: Widget text has “Hello blau blau de blau” in it.
    I want HELLO to be in white and a differnt font and the rest in blackand defualt font.
    Just to confirm – your suggestion is then correct for this scenario.
    Out of interest is there not a plug in that can do this kind of styling in widgets? Lightbulb moment!!!

    Yes, if you are adding it in the dashboard to a widget, it won’t be lost upon updating.

    Check these out:

    https://www.ads-software.com/extend/plugins/ultimate-tinymce/

    https://www.ads-software.com/extend/plugins/tinymce-advanced/

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    thanks WP – I have a look, might be a big time saver overall.
    appreciate the time and experience yo give to us novice learners.

    Thread Starter jgoldberg2013

    (@jgoldberg2013)

    Plugins look amazing – great for page and post styling, need to just qualify if it will work with test widgets.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘multi-color text in div’ is closed to new replies.