CSS has a lesser-known :target selector to style an element that matches the element linked in the page hash. When someone is linked to https://mailcoach.app/#how-to-send-a-campaign, the target selector can be used to make the title stand out between the rest of the content. We can also display hidden content with the :target selector.

With the :target selector, we can set up a Mailcoach subscribe form with a custom success message.

The :target selector is a great way to display a message without creating a separate confirmation page or relying on JavaScript.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners