Course Content

If you are facing any issue in playing video please use Firefox browser.

Course Content

Description

Attribute Selector In CSS3

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 :
input[type=text]{ background:red;}
Now again define different input type in HTML:
<input type= “email” value= “abc@demo.com”>

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.

FAQs

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download The Apps

Code Scan or Download the app
Google Play Store
297K+ Downloads
4.5 Rating
10K+ Reviews
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere