Newbie to CSS. I don't get why :before and :after are used. Can I get some easy explanation,please?
When we use
before it means, this css will apply (virtually) before the default content in html element, and vice-versa for
after but the catch is these are called pseudo selectors, which does not change the real DOM, i.e. the change would be visible but not real.
Refer this to learn more about it : https://css-tricks.com/almanac/selectors/a/after-and-before/