What Are :before and :after Pseudo #elements?
▻https://hackernoon.com/what-are-before-and-after-pseudo-elements-fabb2c6eee3?source=rss----3a81
The #css :before and :after properties are what also known as pseudo elements. They are used to add something before or after the content of an element. There are a lot of great uses for these pseudo elements, so let’s explore some of them.The SyntaxIf you have an element like this one:<h2>welcome to our website</h2>You can add a pseudo element before it using CSS, like this:h2:before content: “Hello“; color : blue;The result will be:This is a quite simple principle. You are adding content before or after a certain element. It can be extremely helpful when adding icons, clearing floats, and in many other cases.The content property of the pseudo element can be left empty with empty quotes like this content: “”. This way you can treat the pseudo element like a box with no content. If (...)