We want to create a simple tab view like this one:
Generally we add a link to point to a page but we can also add ‘#id‘ to point it to a specific element.
When we click on the link, browsers will try to focus on the element. At that time, we can adjust the style of the elements to create tab view.
To do that we are going to use the CSS ‘:target‘ selector.
CSS :target Selector
The element we link into a tags using ‘#id‘ to is the target element. So, we can use it to style the current active target element.
We’ll use CSS display property on that targeted element to create the tab interface.
css selectors display link pseudo-elements tab target