7

Okay, what I want is this: When the <p> tag ends with </p>, I want to add a character at the end of the line. For example

<p>Something and more!</p>

Should look like

Something and more!_

Where the '_' (underscore) is the added character.
Is this possible with CSS?
Is it also possible at the end of a line?

DwB
  • 37,124
  • 11
  • 56
  • 82
Highmastdon
  • 6,960
  • 7
  • 40
  • 68

3 Answers3

5

Yes it is possible

p:after{
    content:"_";
}
Nasreddine
  • 36,610
  • 17
  • 75
  • 94
4

If I've understood your question right, then I think the following works as you require:

p:after {
    content: '_';
}

JS Fiddle demo.

Which seems compatible even with IE 8 and above.

David Thomas
  • 249,100
  • 51
  • 377
  • 410
2

You can use the pseudo-class :after:

p:after { content: '_'; }

It’s not possible for each line though, as CSS practically does not know about “lines”.

poke
  • 369,085
  • 72
  • 557
  • 602