If you are facing any issue in playing video please use Firefox browser.
CSS pseudo-class, target elements that can’t be targeted with combinatory or simple selectors like id or class. For this, we have not to do coding in HTML, we can define directly it in CSS. We can add pseudo class to any ID, class or default tag of HTML. Let’s understand the working of pseudo class and what the types of it are.
First is attribute selector. The attribute selector is used to select elements with a specified attribute.
Let’s see Example of this :
Write this in HTML : <input type= “text” value= “attr”>
And following syntax in CSS :
Now again define different input type in HTML:
<input type= “email” value= “firstname.lastname@example.org”>
Check on webpage, this section will not get red background as we have defined that for only text input. So as we discussed, CSS works on specified attributes. This is called as Target based attributes.
Have a friend to whom you would want to share this course?