Day 3: Pseudo-element selectors, selector specificity, inheritance and colors

Pseudo-element selectors are used to style a part of the element.For example:<p>ABCDEFGHIJKLMNOPQRSTUVWXYZ</p> We can style the letter "A" using:p::first-letter { color: red;} Pseudo-element selector is used to style a part of an element and pseudo-class selector is used to style an element in a particular state. Other pseudo-elements selectors are:::selection -> It is used to … Continue reading Day 3: Pseudo-element selectors, selector specificity, inheritance and colors

Day 2: Pseudo-class selectors

In CSS, we have a few pseudo-classes. Now, how do the pseudo-classes work. <article> <p class="first">Lorem ipsum dolor sit amet.</p> <p>Lorem ipsum dolor sit amet.</p></article>article .first { color: orange;}The above works the same as the below code: <article> <p>Lorem ipsum dolor sit amet.</p> <p>Lorem ipsum dolor sit amet.</p></article>article :first-child { color: orange;}But it is a … Continue reading Day 2: Pseudo-class selectors