Highlighting by enclosing the text in tags

This is the most basic method of highlighting, and works well for simple use cases.

It involves adding a tag, such as a SPAN, which encloses the highlighted text. This tag can then be given a style such as a background color, and that’s about it – highlighting done.

Simple example

Highlighting text within one paragraph:

The following tag could then be added:

Multi-paragraph example

Say you wanted to highlight the following text:

You could do this:

But I believe that would be invalid as the SPAN element must be contained within a P.

So you would have to split the SPAN between the two paragraphs – like this:

And this: