2 replies [Last post]
roef
roef's picture
Offline
newbie
Last seen: 3 weeks 1 day ago
Timezone: GMT+1
Joined: 2018-11-24
Posts: 2
Points: 3

Hello,

So I was wondering. Is it possible to change the colour of dots at endings of sentences to a particular colour for the whole website? Using . throughout the website is not very efficient. Is there any CSS trick to do this easy with one line?

Thanks in advance.

Regards,

Roef

roef
roef's picture
Offline
newbie
Last seen: 3 weeks 1 day ago
Timezone: GMT+1
Joined: 2018-11-24
Posts: 2
Points: 3

Woops I meant: "using <font

Woops I meant: "using <font color="#">.</font> throughout the website is not very efficient"
Forgot the code tag.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 14 hours 29 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9716
Points: 3792

Use case?

I honestly cannot think of a sane use case for what you ask. I will try to suggest a means of segregating a character for style or scripting purposes. There is no really efficient means of doing this. A find and replace action in your editor can work. But, for example, if you want to change only the period that ends a sentence, how do you differentiate the dots ending sentences, the dots in abbreviations or decimal points in numbers? Fortunately, in my editor, I can do this along with some other helpful functions. It does require some typing rules; I use the old fashioned American custom of a double white space at the end of a sentence.

First, the font tag is invalid. It is supported only for legacy purposes. The proper generic segregating tag, absent an actual semantic tag, is the span.

In your editor, search for ".  ". Note the double white space after the dot.

Replace with <span class="dots">.  </span>

In your style sheet, do this:

span.dots {
    color: red;
    }

You will still need to do some by hand, eg. sentences that are at the end of a paragraph.

Never, ever put style stuff in the html document.

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.