On my site I show a list of featured posts on the front page. They show an excerpt (if available) and the first 42 words of the post, before the “read more” button.
I’d like to add three trailing dots directly after the 42 words, but if I do it in the index.hbs file, they show up just over the read more button. Is there a way to achieve this?
One way to approach this is via CSS. You’d want to add a class to the excerpt to make it easier to target. Then, you can add this CSS to Code Injection or your theme:
Thanks you very much RyanF, this almost works for me. I have added the CSS in the code injection part of the CMS, but simply cannot get the three dots to show up where I want them (like in your screenshot). I have tried various versions of the code below in my index.hbs but best case it shows up just above the “Læs mere” button like before (for some reason I can not upload a photo, but it’s visible on Esbens Hardenbergs blog now).
Rather than adding the class to the span element, add it to the <p> tag that’s inside the span. (You probably don’t need the span at all.) That should help put the dots where you need them!
Because you’re using content, we can’t predict exactly what’s going to come through. This CSS targets the last element in the excerpt container and adds the ...