HTML User Interface for multiple tags

If you want to allow the user to select tags and their combinations to filter certain content (with the tags created by the content-creators), what would be a good way to select

  1. single tags, and
  2. groups of tags

in HTML?

Each single content item only has a limited number of tags like a StackExchange question, . Differently to StackExchange tag selection, tags are not curated: there can be any number of them and there can be different tags with the same meaning.

In contrast to Do users really need to search through a tag page?, which has a global view, this is about a browser extension which only sees the given content's tags at a time. In contrast to Tags! Massive amounts of tags and a sane interface to use them, there is only a limited number of tags, between 3 and maybe 10.