Shortcodes are special kinds of content that users can attach to certain pages by adding the corresponding tag into the post or page text. Shortcodes can include buttons, alerts, and more advanced things like previews of posts or interactive forms.
Shortcodes are usually enclosing, so they include content in between the opening and closing tags of the shortcode. This content can usually include anything WordPress supports – images, formatted text etc. An example of an enclosing shortcode is this:
[button]Enclosing shortcode content[/button]
However, shortcodes can also be self-closing, which means they do not include a closing tag or any content. An example of a self-closing shortcode is this:
[button text="Button content"]